I want to know the codes for each button that I use for my (car mp3 remote control), I write the following programming code:
#include <IRremote.h>
int Recv_Pin=8;
IRrecv irrecv(Recv_Pin);
decode_results results;
void setup() {
Serial.begin (9600);
irrecv.enableIRIn();
}
void loop() {
if (irrecv.decode(&results)){
Serial.println (results.value);
}
}
but when I upload it to the arduino board, it keeps giving the same code for different bottons. So is my code correct, and how to solve this problem and know the right code for each button ?
Writing down the codes along with keeping a track of unknown codes can help in cracking the difficulties easily.
Abhishek
PermalinkYou first need to decode output of all the remote buttons and then code them accordingly.
If you don’t know the Decoded output for your IR remote, it can be easily found, just follow these steps:
For more information go through this project: IR Remote Controlled Home Automation using Arduino
- Log in or register to post comments
Joined May 19, 2015 402Tuesday at 03:13 PM