I am working with some student at school, trying to get an IR Receiver to turn a motor. I am having an issue with the remote, giving different reading every time. I want the IR Receiver to detect a signal and then turn a SERVO 90 degrees.
Here are the Codes i received pressing the same button on a AC Remote.
C1A6613E
C509B7F9
B258ECED
5D0F829A
4C73FC95
F2318C8B
5A535141
541D7E9
5A172971
FB91650C
9D549C3A
233AC560
D277E549
5C0C6A0
30F23B53
388B8B37
7C4FDAF9
7BA53359
975CC33B
9D5243DE
Here is the basic code:
/*
- 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 <IRremote.h>
int RECV_PIN = 2;
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
}
delay(10);
}
Any ideas on the issue with the code?
What code would I have to put in for the servo to turn 90 degrees?????
Thanks