NicoHood / IRLremote

Lightweight Infrared library for Arduino
http://www.nicohood.de
168 stars 37 forks source link

V1.7.3 Does not work with Teensy #3

Open NicoHood opened 9 years ago

NicoHood commented 9 years ago

The Code compiles with warnings but doesn't work. Splitted this issue: https://github.com/NicoHood/IRLremote/issues/2

TomD62 commented 9 years ago

Running the ARM based Teensy 3.0 and 3.1 boards With 1.0.6 Arduino IDE (IDE 1.5.x not supported by Teensy 3.x) No IRLavailable detected, I've tried Pin 0,1,2,11,13 . On pin 13, I can see the LED being driven by the IR sensor flicker when I press a remote What demo would be best for debugging this?

NicoHood commented 9 years ago

Hi Tom, the No Blocking Demo seems to be the best for debugging. I just don't know anything about a Teensy and dont know how it manages the Interrupts etc.

I first would just add a Serial print in the ISR attached function for interrupt managing. I know "never print in ISRs" but you can do this to simply know if the ISR itself is triggering.

You can also test the Raw demo, it it triggers and see what this does. Then you have to check if the timings are correct.

TomD62 commented 9 years ago

This code does work: // toggles LED when interrupt pin changes state // for much more detail on Interrupts and ISRs http://gammon.com.au/interrupts int pin = 13; volatile int state = LOW; // http://arduino.cc/en/Reference/Volatile

void setup() { pinMode(11, INPUT); pinMode(pin, OUTPUT); attachInterrupt(11, blink, CHANGE); // interrupt 0 on an Uno is Pin 2 http://arduino.cc/en/Reference/AttachInterrupt // the ISR is blink() // the mode is CHANGE }

void loop() { digitalWrite(pin, state); }

void blink() { state = !state; }

NicoHood commented 9 years ago

Sorry Tom, you have to dig into that yourself unless I own a Teensy. I could suggest you things to debug, but this would take ages, also without a logic analyzer :S

TomD62 commented 9 years ago

I tried a generic ISR, it works on whatever pin I attach it to with the Teensy3.

I think my plan will be to compile both and have a look at the .elf assembly code, or simplify yours by flattening the ISR to a simple function call instead of the template code. I tried just putting a LED blink in the ISR, but declarations and scope are tripping me up. My C++ is pretty limited, having a hard time following all the template syntax. Assembler, I can follow that :)

On Sat, Dec 6, 2014 at 11:38 AM, Nico notifications@github.com wrote:

Sorry Tom, you have to dig into that yourself unless I own a Teensy. I could suggest you things to debug, but this would take ages, also without a logic analyzer :S

— Reply to this email directly or view it on GitHub https://github.com/NicoHood/IRLremote/issues/3#issuecomment-65906579.

Jerware commented 9 years ago

It would be great to see this library working on Teensy 3.1. I would be happy to donate $20 to the cause (the cost of a Teensy).

NicoHood commented 9 years ago

I already own a Teensy (someone else donated it). Feel free to donate anyways (maybe for a Teensy LC or just for motivation?) ;D

I am sorry, that it doesnt work yet. I have so many personal things at the moment and 6 private coding projects. So I cannot cut me into pieces :D I have this teensy for 1 or 2 Month now and I didnt even had the chance to upload a blink to it. But thx for the reminder. Sometimes I get accidently interest in working on another project again. I wont be able to access any of my Arduinos till next monday. You could remind me on Monday and I'll maybe have a quick look. Maybe the fix is easier as expected. Shouldnt be too complicated.

Jerware, at what protocol are you looking for? So I know what priority I can set ;)

Jerware commented 9 years ago

Thanks, NicoHood. I already wired up a workaround (another Teensy acting as IR receiver that transmits codes as Serial data). Before doing that I posted to the Teensy forum to see if anyone had interest in porting your code, and it seems that while your implementation makes great sense on Arduino, it makes less sense on Teensy. A proper port would effectively be a different approach entirely, which probably warrants its own library.

You can see the thread here: https://forum.pjrc.com/threads/28001-IRLremote-(not-IRremote)-Compatibility

NicoHood commented 9 years ago

Thx for the link. Well that could be true. I'll have a look at it anyways just to see if it works. Maybe I get net ideas then ;)

NicoHood commented 9 years ago

Is anyone willing to test the dev2 branch for Teensy? If it throws compile errors a full list of them would be nice. IDE1.6.6 is required, not sure if Teensy supports this.

I do have a Teensy hardware though, but not here atm. and I also cannot use a patched IDE version, since I am working at the bleeding edge of the IDE and report bugs/help developing.

Same goes for the ESP. If anyone is willing to test it and open a PR to fix compile errors, feel free. CC @probonopd

bam80 commented 9 years ago

What Teensy's this issue about - ARM or AVR based? I would test it on ARM but I haven't one currently

NicoHood commented 9 years ago

Teensy is ARM and I never used ARM. I have one but I dont intend to use it. Just got no time and use for it. (Teensy 3.1)

jpk73 commented 11 months ago

Successfully running on Teensy2! But can't decode B&O codes especially the ones that are repeated back to back. Tried various settings for timeout etc. but couldn't get it to recognize the commands properly (using a genuine 455kHz receiver)...