Hello everyone,
I am trying to get my servo to turn when I press a button on a remote. Here is the code (sorry if it is formatted weirdly I made this account today):
#include <IRremote.h>
#include <Servo.h>
//fwd 9
//bck 7
Servo myservo;
int val;
const byte IR_RECEIVE_PIN = 11;
void setup() {
Serial.begin(9600);
Serial.println("IR Receive test");
IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
myservo.attach(9);
}
void loop() {
if (IrReceiver.decode()) {
Serial.println(IrReceiver.decodedIRData.command, HEX);
IrReceiver.resume();
}/*
if (results.value == fwd) {
myservo.write(30);
delay(15);
}
if (results.value == bck) {
myservo.write(0);
delay(15);
}*/
}
My main problem is the bottom part.
Thank you all very much !!