Hello, i recently bought 2 tg9e servos, and i am trying to control them with a remote control, the problem is that once a press a button the servo goes to the specified angle but immediately returns to the initial position, and i dont think its supposed to do that, especially cause when a put weight on it with my finger it works just fine (it goes to the specified position and stays there until a next coordenate is entered).
my code (just in case):
#include <Servo.h>
#include <IRremote.h>
Servo myservo;
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
int pos = 0;
int go = 0 ;
void setup()
{
myservo.attach(9);
myservo.write(pos);
irrecv.enableIRIn();
}
void loop()
{
pos = myservo.read();
if (pos == go){
if (irrecv.decode(&results)) {
switch(results.value){
case 0xE17A807F: go = 90; break;
case 0xE17A40BF: go = 179; break;
case 0xE17AC03F: go = 0; break;
}
irrecv.resume();
}
}
else{
myservo.write(go);
delay(15);
}
}
I'd appreciate any help