Hey there, im trying to make a basic bluetooth code using serial ports to my arduino uno but its impossible for me to upload it. Im using the correct port and i've looked up a lot of problems trying to reset the board but i cant. He're is the code:
#include <Servo.h>
Servo myservo;
int pin = 11;
int state = 0;
void setup(){
myservo.attach(pin);
Serial.begin(9600);
}
void loop(){
if(Serial.available()){
state = Serial.read();
}
myservo.write(45);
delay(1000);
if(state == 'O'){
myservo.write(180);
delay(500);
}
}
Any ideas?