Tenho tido dificuldades em colocar esta placa a mexer um servo.
ERRO:Aviso: platform.txt do núcleo «Arduino AVR Boards» contém recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} “{build.path}/{archive_file}” “{object_file}” deprecados, convertidos automaticamente para recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} “{archive_file_path}” “{object_file}”. Considere actualizar este núcleo.
AVISO: a biblioteca Servo diz que pode ser executada em arquitectura(s) avr, megaavr, sam, samd, nrf52, stm32f4, mbed e pode ser incompatível com a sua placa actual que é executada em arquitectura(s) AVR.
Ficheiro do bootloader especificado mas não encontrado: C:\Program Files (x86)\Arduino\hardware\WAV8F\AVR\bootloaders\lgt8fx8e\optiboot_lgt8f328d.hex
CODIGO:
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards
int pos = 0; // variable to store the servo position
void setup() {
myservo.attach(1); // attaches the servo on pin 9 to the servo object
Serial.begin(9600); // open a serial connection to your computer
}
void loop() {
for (pos = 0; pos <= 10; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for (pos = 10; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
Serial.print("posVal: ");
Serial.print(pos);
}