Hello!
I'd like to control a servo while out of its physical and wifi range, but I'm having some trouble with that.
- The ANESP32 is plugged and the Create Agent founds it
- On cloud.arduino.cc I've added the device, a new thing with the device attached and created the read-and-write-on-change "servo" int. variable. Plus, added a slider attached to the variable from 0 to 180 in a dashboard
- Created a new network connection using my 2.4GHz Wifi and the secret key
- A servo is connected using a breadboard to the 3.3V header, GND and D10 on an Arduino Nano ESP32
The code is posted below:
#include "thingProperties.h"
#include <Servo.h>
Servo myservo;
void setup() {
Serial.begin(9600);
delay(1500);
myservo.attach(10);
initProperties();
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
setDebugMessageLevel(2);
ArduinoCloud.printDebugInfo();
}
void loop() {
ArduinoCloud.update();
}
void onServoChange() {
myservo.write(servo);
}
After veryifing and uploading on the COM9, bot the Sketch and the Web Editor return an error:
In file included from /tmp/1925118414/sketch_sep21a/sketch_sep21a.ino:1:
/home/builder/Arduino/libraries/servoesp32_1_1_1/src/Servo.h:68:81: error: call to non-'constexpr' function 'const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = int]'
static const int TIMER_RESOLUTION = std::min(16, SOC_LEDC_TIMER_BIT_WIDE_NUM);
^
/home/builder/Arduino/libraries/servoesp32_1_1_1/src/Servo.h: In member function 'T ServoTemplate<T>::mapTemplate(T, T, T, T, T) const':
/home/builder/Arduino/libraries/servoesp32_1_1_1/src/Servo.h:256:28: error: 'is_floating_point_v' is not a member of 'std'
if constexpr (std::is_floating_point_v<T>) {
^~~~~~~~~~~~~~~~~~~
/home/builder/Arduino/libraries/servoesp32_1_1_1/src/Servo.h:256:28: note: suggested alternative: 'is_floating_point'
if constexpr (std::is_floating_point_v<T>) {
^~~~~~~~~~~~~~~~~~~
is_floating_point
/home/builder/Arduino/libraries/servoesp32_1_1_1/src/Servo.h:256:49: error: expected primary-expression before '>' token
if constexpr (std::is_floating_point_v<T>) {
^
/home/builder/Arduino/libraries/servoesp32_1_1_1/src/Servo.h:256:50: error: expected primary-expression before ')' token
if constexpr (std::is_floating_point_v<T>) {
^
Multiple libraries were found for "Servo.h"
Used: /home/builder/opt/libraries/servoesp32_1_1_1
Not used: /home/builder/opt/libraries/xmc_servo_1_0_1
Not used: /home/builder/opt/libraries/evive_2_0_3
Not used: /home/builder/opt/libraries/servo_1_2_1
Not used: /home/builder/opt/libraries/rokitsmart_1_0_9
Not used: /home/builder/opt/libraries/esp32_esp32s2_analogwrite_5_0_2
Not used: /home/builder/opt/libraries/microbitv2_hhs_0_1_6
Not used: /home/builder/opt/libraries/printoo_library_1_0_2
Error during build: exit status 1
Could you please help me understanding what's going on?
Thanks,
Vincenzo
EDIT 1:
I've tried the NANO ESP32 Blink example in the local Arduino IDE and works like a charm
EDIT 2:
Same goes for the Arduino Web Editor