I am using UNO R4 v 1.0.1. When I compile the following simple program:
#include <Servo.h>
Servo myservo; // create servo object to control a servo
void setup() {
myservo.attach(5); // attaches the servo on pin 9 to the servo object
if(myservo.attached()){
Serial.println("Attached");
}
else{
Serial.println("Not attached");
}
}
void loop(){
delay(1000);
}
I get the following compilation error:
WARNING: library Servo claims to run on avr, megaavr, sam, samd, nrf52, stm32f4, mbed, mbed_nano, mbed_portenta, mbed_rp2040, renesas architecture(s) and may be incompatible with your current board which runs on renesas_uno architecture(s).
/tmp/arduino/sketches/36FAC291AF60C805999F6ED9B4200DEA/sketch/sketch_jun27a.ino.cpp.o: In function `setup':
/tmp/.arduinoIDE-unsaved2023527-98555-zhjyf2.s3jvf/sketch_jun27a/sketch_jun27a.ino:9: undefined reference to `Servo::attached()'
collect2: error: ld returned 1 exit status
exit status 1
Compilation error: exit status 1
This also occurs on the Uno R4 Minima
This does not occur on an Uno R3.