bengtmartensson / AGirs

A Girs infrared server for the Arduino
http://www.harctoolbox.org/Girs.html
GNU General Public License v2.0
55 stars 13 forks source link

Can't capture with 32u4 (but the Infrared4Arduino example works fine??) #61

Closed ExplodingWaffle closed 3 years ago

ExplodingWaffle commented 3 years ago

Hello! First, I must say that this + IRscrutinizer is a wonderful bit of software you've made. With codes off the web + a simple IR led I've managed to replace a few remotes that have gone MIA. However in my next step I'm trying to capture (not recieve ;) )codes from a remote, using a breakout I've made for the VSOP98260. (That said, this is not a hardware issue as far as I can tell, since...) Using both the IRLib2 freq example and the Infrared4Arduino IrWidgetAggregating example, the arduino appears to be capturing just fine, however with AGirs and IRScrutinizer, it just times out. tbh i think this is just a configuration issue? It's rather complicated (took me 15 minutes to figure out that the "logical pins" for the LEDs are not arduino pins- why??) image image That said, the hardware does not change between the two screenshots here- the IR out pin is connected to pin 4 on the arduino (a Polulu A-Star 32U4 Mini LV, but as you can see in the screenshots I'm just telling the IDE that it's a Leonardo) Probably just doing something stupid- figured you might know what :) Girs.zip my sketch, but the config is hardly changed so I don't think that would help much

ExplodingWaffle commented 3 years ago

Fixed this by updating AGirs to master- before I was using the latest from the arduino library manager

bengtmartensson commented 3 years ago

Thanx for bringing this problem to my attention, and glad that you fixed it. I will look into it the next few days, and (likely) update the arduino library manager version.

ExplodingWaffle commented 3 years ago

yes I think the update would probably be appreciated- much more convenient than github imo- i had issues building from the zip without copying a few files around Just out of curiosity- would it be possible to add a variable or define somewhere to flip the polarity of the transmit pin? in my circuit the led is connected to a P channel fet- so low means the led is on and vice versa. managed to hack together a fix but might be a nice thing to have in general.

bengtmartensson commented 3 years ago

Just out of curiosity- would it be possible to add a variable or define somewhere to flip the polarity of the transmit pin?

In the class IrSenderNonMod the constructor has a (defaulted) argument invert, which does exactly what you want. However, IrSenderNonMod is probably not the class you want to use. The other sending classes unfortunately do not (yet?) have this, although it should not be too hard to implement. Ideally, this should be a constexpr, so that the compiler can evaluate during compilation, and no runtime (or space) penalties would result.

took me 15 minutes to figure out that the "logical pins" for the LEDs are not arduino pins- why??

The physical-to-logical mapping apples to signalling LEDs only. The idea is that you define the hardware pins in the hardware configuration src/hardware-config/girspin*.h, then the rest of the program, and the user's input, can refer to the pins using their local numbers, and say, for example led 1 on.