Remember that the remote control and the ir receiver is a set, it has to decode the code and will display a hex code.
This is the supplied demo code for the Arduino you can find under File->Examples->IrRemote->IrRecvDemo
/* * IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv * An IR detector/demodulator must be connected to the input RECV_PIN. * Version 0.1 July, 2009 * Copyright 2009 Ken Shirriff * http://arcfn.com */ #include int RECV_PIN = 11 ; IRrecv irrecv( RECV_PIN) ; decode_results results; void setup() { Serial.begin ( 9600 ) ; irrecv.enableIRIn () ; // Start the receiver } void loop() { if ( irrecv.decode ( & results)) { Serial.println ( results.value , HEX) ; irrecv.resume () ; // Receive the next value } }
Before running any code, install LIRC with sudo apt-get install lirc and the follow the prerequisites below
edit /etc/modules and add the lines below:
edit /etc/lirc/hardware.conf and modify to add the correct values as below:
edit /boot/config.txt and edit the dtoverlay value like this:
reboot your pi
after reboot:
your IR receiver is working !
Your email address will not be published. Required fields are marked *
Please login to write review!
Looks like there are no reviews yet.