drivers icon indicating copy to clipboard operation
drivers copied to clipboard

irremote not working properly using Arduino Uno

Open LeonardsonCC opened this issue 3 years ago • 5 comments

Hey, I'm new to embedded stuff, so maybe I have made some mistake.

Trying to make the IR Remote driver to work using an Arduino Uno, it just not received any signal. Debugging the driver code, I notice that if I use the Pin Mode as Input, and change the SetInterrupt to just call pinChange each 10 milliseconds, it receives the controller inputs.

There's any reason for the SetInterrupt and the Pin Mode as InputPullup to not work on Arduino Uno?

Checking Arduino docs, the pins 2 and 3 should be working, right?

LeonardsonCC avatar May 10 '22 13:05 LeonardsonCC

Hi @LeonardsonCC which IR receiver component are you using with the Uno? Can you provide the part number and/or link to the datasheet? Thanks.

neildavis avatar Jul 04 '22 14:07 neildavis

Hi, I believe it is this one: http://eeshop.unl.edu/pdf/VS1838-Infrared-Receiver-datasheet.pdf

LeonardsonCC avatar Jul 04 '22 14:07 LeonardsonCC

Thanks. If I'm reading that datasheet correctly, it's an 'active low' device so the driver config should be compatible. I have a R3 Uno somewhere so will try it soon once I have done some maintenance on my tinygo setup. I'm assuming you were using tinygo v0.23 at the time of reporting?

neildavis avatar Jul 04 '22 15:07 neildavis

Ah, having got the dev env setup, now I see. It seems SetInterrupt() is not implemented in machine.Pin for arduino target, which is more of a tinygo core support issue than a problem with the driver per se. That is a shame though, since as you point out the hw support is there on some pins at least.

I'd suggest opening an issue on the tinygo core similar to this one to ask for arduino/avr support for GPIO interrupts. You're possibly more likely to get a better response over there on why it's not available and/or possible.

neildavis avatar Jul 05 '22 13:07 neildavis

Oh, got it. Thanks for the really helpful explanation. I'll create the issue!

LeonardsonCC avatar Jul 06 '22 13:07 LeonardsonCC