Hey guys the arduino.
I have the following problem, can not develop language that makes my remote to make the servo turn 1 by 1 degree.
I want that when I press the 1 key on the remote control it will rotate 1 degree to the right and pressing the 2 to 1 degree left turn. Starting from 0 and going to 180 and 180 back to 0.
Here’s what I did so far:
#include <Servo.h>
#include <IRremote.h>
int RECV_PIN = 24;
IRrecv irrecv(RECV_PIN);
decode_results results;
Servo myservo;
void setup()
{
** Serial.begin(9600);**
** irrecv.enableIRIn();**
** myservo.attach(9); **
}
void loop() {
** if (irrecv.decode(&results)) {**
** Serial.println(results.value, HEX);**
** irrecv.resume();}**
for(0xB54AC23D == 0; 0xB54AC23D < 180; 0xB54AC23D += 1){
** myservo.write(0xB54AC23D);**
** delay(15);}**
for(0xB54A42BD == 180; 0xB54A42BD >= 1; 0xB54A42BD -= 1){
** myservo.write(0xB54A42BD);**
** delay(15);}**
}