Código a Solucionar tiene 10 errores
#include <Servo.h> // Librería
Servo myservo
//Definición de variables
int pos=0;
int adelante=0
int atras=0;
void setup() {
Serial.begin(9600);
Myservo.attach(9)
// Inicializa pin
pinMode(3, INPUT);
pinmode(5, InPUT);
}
void loop() {
// Lee entrada de pulsación de los botones
adelante = digitalRead(5)
atras = DigitalRead(3);
if (adelante == 1){
pos = pos+1;
if (pos>=180){
pos=180;
}
}
if (atras == 1){
pos=pos-1;
if (pos<=0){
pos=0;
}
}
myservo.write(pos);
delay(15)
}
#include <Servo.h> // Librería
Servo myservo
//Definición de variables
int pos=0;
int adelante=0
int atras=0;
void setup() {
Serial.begin(9600);
Myservo.attach(9)
// Inicializa pin
pinMode(3, INPUT);
pinmode(5, InPUT);
}
void loop() {
// Lee entrada de pulsación de los botones
adelante = digitalRead(5)
atras = DigitalRead(3);
if (adelante == 1){
pos = pos+1;
if (pos>=180){
pos=180;
}
}
if (atras == 1){
pos=pos-1;
if (pos<=0){
pos=0;
}
}
myservo.write(pos);
delay(15)
}