Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pinguino 4550 - IR Remote Control Decoding
02-06-2017, 07:48 PM,
#6
RE: Pinguino 4550 - IR Remote Control Decoding
(02-06-2017, 07:20 PM)Aldeen19 Wrote: derf158
(01-06-2017, 04:03 PM)Aldeen19 Wrote: Thank you Fred that's kind of you and I'll be waiting.

Code:
/*
* DecodeRemote: demonstrates decoding IR codes from a remote control
* An IR detector/demodulator must be connected to the input IRSENSOR.
* Version 0.1 March, 2014
* Author : Regis Blanchot
*/

int RECV_PIN = 2;   // can be any digital pin

decode_results results;

void setup()
{    
   pinMode(11,OUTPUT);
   pinMode(12,OUTPUT);
     
   IRremote.enableIRIn(RECV_PIN);
  IRremote.blink(TRUE);

}

void loop()
{  
   if (IRremote.decode(&results))
   {
   
       if (results.value == 0xF274ADF) {  // button 1
   digitalWrite(11,HIGH);  
   
 }
 if ( results.value == 0x56C403) {   //// button stop
 digitalWrite(12,HIGH);
 
 
 }
       IRremote.resume(); // Receive the next value
   }
}
Aldeen
 try this i used my own code and it worked.
fred
----------------------------------------------------------------------------

Fred,

I have already attempted every possible programming format I could ever think of, changed various pins, changed various number decoding systems from hex into decimal and binary before I asked for help.. and now after trying your sketch the LEDs are still OFF and not responding.. I am frustrated.
 
More specifically, by watching the serial terminal I figured out that my Pinguino is actually decoding the incoming signals but not executing the 'if' conditions of turning LEDs ON !!?.. as if there is something wrong with the firmware of 4550 or in the IR library included.

For your information; My Pinguino is self-made 4550 clocked 20MHz, IDE is v11Beta4 compiler type is SDCC,  using Hyper Terminal app of Windows XP SP3 for watching the serial port,   IR sensor is TSOP38238 and the remote TX unit is of unknown brand.   Please see attached photo and tell me what you think ?
Aldeen,
 I will try this on V11 i am using V12 i use the hex value on thing to note in irremote.c a value needs to be changed see  the code i changed 50 to 26

Code:
// nb cycles for 50us
   _tmr_reload_val = ( System_getPeripheralFrequency() / 1000 / 1000 ); // 1us = 12 cycles @ 48MHz
    _tmr_reload_val *= 26; // 50us = 50 * 12 cy @ 48MHz
  // _tmr_reload_val *= 50; // 50us = 50 * 12 cy @ 48MHz
   _tmr_reload_val = 0xFFFF - _tmr_reload_val;
Reply


Messages In This Thread
RE: Pinguino 4550 - IR Remote Control Decoding - by derf158 - 02-06-2017, 07:48 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)