![]() Void IRsend::sendNEC(unsigned long data, int nbits)įor (int i = 0 i 0) delayMicroseconds(time) #define TIMER_DISABLE_PWM (TCCR2A &= ~(_BV(COM2B1))) #define TIMER_ENABLE_PWM (TCCR2A |= _BV(COM2B1)) ![]() The code in the library that sends the signals looks like this: #define NEC_HDR_MARKę000 This did, however, lead me to something interesting. Thanks! I tried this, and still received no output on the pin. If you look at the examples on the relevant Arduino pages, there's always a check on Serial.available() prior to calling Serial.read(). This might be affecting your results and not triggering the send command as expected. Your original code is reading the serial buffer continuously through the loop() without checking if anything is available. Try sending the IR command in the setup() without any kind of trigger. Just to be sure, I checked both my LEDs (infrared and yellow) as well as the port 3 (using a blinking light sketch) to make sure everything still works, and it all seems to be fine. I've replaced the 20 ohm resistor with a 100 ohm resistor and it still lights just fine. Thanks for pointing that out! I don't need that much power (it's a tiny LED). 2N7000) or transistor with that LED current. If you look at the examples on the relevant Arduino pages, there's always a check on Serial.available() prior to calling Serial.read().Ģ0ohm (~60-65mA) could kill the output pin.īetter to drive the LED with a small mosfet (e.g.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |