Page 1 of 1

Simple IR Sending w PWM

Posted: Wed May 04, 2016 7:17 pm
by DrJFM
This will simplify my use of a wifi Digistump Oak to control my Stereo system that resides in the basement.
AnalysIR nailed my old old Onkyo receiver as using NEC codes. The other piece I want to control is a Sony but let me see it as a 12 bit code.

Tried the NEC using your hex send routine from Blog using UNO and works as expected using pin 7 and no interrupts.

Now to the Oak and to porting the Sony to your PWM method. Oak is 80 Mhz so should have more time to mess around and still get OK timing.
Issue is if the WiFi overhead messes up the signal modulation, but should be able to manage for the duration of these IR bursts.
Wouldn't mind a word on tuning the output based on 80 Mhz versus 16 Mhz UNO

I am here in Feedback because I spotted a cut and past error in the code for the PWM III sketch. looks like you copied the NEC code for a template for the Mitsubishi send
but left the NEC Hex line unmodified.
//Next send the Mitsubishi88AC_Hex signal defined above
Serial.println(F("Sending Mitsubishi88AC_Hex @ 33kHz"));
sendHexNEC(NEC_HEX_VALUE, NEC_BIT_COUNT, 1, 33);
delay(5000); //wait 5 seconds between each signal (change to suit)
No biggie -- typo is in download and in the in line descriptive text both.
also, earlier #define NEC_HEX_VALUE 0x20DF22DDL
seems to have added L to the hex system...

May also try the RFduino as well.

Likely no one using AnalysIR will be very confused by these, but you also get some google hits from folks who might be confused.
Thanks!
James

Re: Simple IR Sending w PWM

Posted: Sun May 08, 2016 7:29 pm
by AnalysIR
looks like you copied the NEC code for a template for the Mitsubishi send but left the NEC Hex line unmodified.
The typo was in the comment and Serial.println.
I have now corrected this on the blog and in the download.

Code: Select all

#define NEC_HEX_VALUE 0x20DF22DDL
This isn't a typo and should compile fine (it does on my Arduino IDE).The 'L' forces the compiler to treat the value as a 32 bit long. I have also changed this to UL / unsigned long, instead of L / signed long.