Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pinguino 4550 - IR Remote Control Decoding
01-06-2017, 01:24 PM,
#2
RE: Pinguino 4550 - IR Remote Control Decoding
(30-05-2017, 12:46 AM)Aldeen19 Wrote: I am trying to remotely control a couple of digital outputs individually in my Pinguino 4550 by the sketch stated below which is already based on decoding example developed by Regis,   but unfortunately not working!.. don't know what is wrong.
I am pretty sure of all the connections but not wizard in C programming.
Please, any help will be appreciated:

/*
* 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
*/

#define IRSENSOR 0 // pin 0 the input pin from IR sensor
int ledpin1 = 1;
int ledpin2 = 2;

char brand[][10] = {"UNKNOWN", "NEC", "SONY", "RC5", "RC6", "DISH", "SHARP", "PANASONIC", "JVC", "SANYO", "MITSUBISHI"};

decode_results results; // Results returned from the decoder

void setup()
{
pinMode(ledpin1,OUTPUT);
pinMode(ledpin2,OUTPUT);

IRremote.enableIRIn(IRSENSOR); // Start the receiver
IRremote.blink(true); // Built-in led will blink at reception

Serial.begin(9600);
}

void loop()
{
if (IRremote.decode(&results)==DECODED)
{
if (results.decode_type>10)
results.decode_type = 0;

Serial.print(" Decoded ");
Serial.printNumber(results.value,HEX);
Serial.print(" (type ");
Serial.print(brand[results.decode_type]);
Serial.print(")\r\n");

if (results.value == 0xF274ADF) {
digitalWrite(ledpin1,HIGH);
}
if (results.value == 0x56C403) {
digitalWrite(ledpin2,HIGH);
}
}

IRremote.resume(); // Ready to receive the next value
}
Aldeen
 when i get home tonight i will help you
fred
Reply


Messages In This Thread
RE: Pinguino 4550 - IR Remote Control Decoding - by derf158 - 01-06-2017, 01:24 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)