The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 864 - File: showthread.php PHP 7.2.19 (Linux)
File Line Function
/showthread.php 864 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pinguino 4550 - IR Remote Control Decoding
30-05-2017, 12:46 AM,
#1
Question  Pinguino 4550 - IR Remote Control Decoding
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
}
Aldeen19
Reply


Messages In This Thread
Pinguino 4550 - IR Remote Control Decoding - by Aldeen19 - 30-05-2017, 12:46 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)