Ciao a tutti sono nuovo e sto provando a governare un servo motore in remoto dal cloud ma lo stesso codice che uso nell'IDE è considerato come errore.
/usr/local/bin/arduino-cli compile --fqbn arduino:mbed_giga:giga:split=100_0,target_core=cm7 --build-cache-path /tmp --output-dir /tmp/2246149042/build --build-path /tmp/arduino-build-90C1DEA221394975E2DE6347505067FD /tmp/2246149042/Untitled_jul02b
/tmp/2246149042/Untitled_jul02b/Untitled_jul02b.ino:3:7: error: no matching function for call to 'Servo::Servo()'
Servo myservo;
^~~~~~~
In file included from /tmp/2246149042/Untitled_jul02b/Untitled_jul02b.ino:2:0:
/home/builder/Arduino/libraries/vovagorodok_servo_1_0_0/src/Servo.h:7:5: note: candidate: Servo::Servo(uint8_t, int, bool)
Servo(uint8_t pin, int degree, bool activeState = HIGH);
^~~~~
/home/builder/Arduino/libraries/vovagorodok_servo_1_0_0/src/Servo.h:7:5: note: candidate expects 3 arguments, 0 provided
/home/builder/Arduino/libraries/vovagorodok_servo_1_0_0/src/Servo.h:4:7: note: candidate: constexpr Servo::Servo(const Servo&)
class Servo
^~~~~
/home/builder/Arduino/libraries/vovagorodok_servo_1_0_0/src/Servo.h:4:7: note: candidate expects 1 argument, 0 provided
/home/builder/Arduino/libraries/vovagorodok_servo_1_0_0/src/Servo.h:4:7: note: candidate: constexpr Servo::Servo(Servo&&)
/home/builder/Arduino/libraries/vovagorodok_servo_1_0_0/src/Servo.h:4:7: note: candidate expects 1 argument, 0 provided
/tmp/2246149042/Untitled_jul02b/Untitled_jul02b.ino: In function 'void setup()':
/tmp/2246149042/Untitled_jul02b/Untitled_jul02b.ino:17:11: error: 'class Servo' has no member named 'attach'
myservo.attach(5);
^~~~~~
/tmp/2246149042/Untitled_jul02b/Untitled_jul02b.ino: In function 'void loop()':
/tmp/2246149042/Untitled_jul02b/Untitled_jul02b.ino:24:13: error: 'class Servo' has no member named 'write'
myservo.write(180);
^~~~~
/tmp/2246149042/Untitled_jul02b/Untitled_jul02b.ino:26:13: error: 'class Servo' has no member named 'write'
myservo.write(0);
^~~~~
/tmp/2246149042/Untitled_jul02b/Untitled_jul02b.ino: At global scope:
/tmp/2246149042/Untitled_jul02b/Untitled_jul02b.ino:32:1: error: expected declaration before '}' token
}
^
Multiple libraries were found for "WiFi.h"
Used: /home/builder/.arduino15/packages/arduino/hardware/mbed_giga/4.1.3/libraries/WiFi
Not used: /home/builder/opt/libraries/wifi_1_2_7
Not used: /home/builder/opt/libraries/wifiespat_1_4_4
Not used: /home/builder/opt/libraries/betterwifinina_1_3_0
Not used: /home/builder/opt/libraries/wifinina_1_8_14
Not used: /home/builder/opt/libraries/indhilib_3_0_5
Not used: /home/builder/opt/libraries/vega_wifinina_1_0_1
Not used: /home/builder/opt/libraries/seeed_arduino_rpcwifi_1_1_0
Not used: /home/builder/opt/libraries/nina_wi_fi_1_0_1
Not used: /home/builder/opt/libraries/da16200_wi_fi_library_for_arduino_1_1_0
Multiple libraries were found for "ECCX08.h"
Used: /home/builder/opt/libraries/arduinoeccx08_1_3_8
Not used: /home/builder/opt/libraries/rak5814_atecc608a_1_0_0
Multiple libraries were found for "Servo.h"
Used: /home/builder/opt/libraries/vovagorodok_servo_1_0_0
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/evive_2_0_3
Not used: /home/builder/opt/libraries/printoo_library_1_0_2
Not used: /home/builder/opt/libraries/servo_1_2_2
Not used: /home/builder/opt/libraries/servoesp32_1_1_1
Not used: /home/builder/opt/libraries/microbitv2_hhs_0_1_6
Not used: /home/builder/opt/libraries/xmc_servo_1_0_1
Not used: /home/builder/opt/libraries/servoesp32fix_1_1_2
Multiple libraries were found for "Wire.h"
Used: /home/builder/.arduino15/packages/arduino/hardware/mbed_giga/4.1.3/libraries/Wire
Not used: /home/builder/opt/libraries/flexwire_1_2_1
Error during build: exit status 1
Questo è l'errore che ottengo al seguente codice:
#include <Servo.h>
Servo myservo;
#include "thingProperties.h"
void setup() {
Serial.begin(9600);
delay(1500);
initProperties();
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
setDebugMessageLevel(2);
ArduinoCloud.printDebugInfo();
myservo.attach(5);
}
void loop() {
ArduinoCloud.update();
if (digitalRead(botton)==HIGH){
myservo.write(180);
}else{
myservo.write(0);
}
}
}
Perdonatemi per il lungo messaggio o errori nell'indicazione del codice.
Grazie in anticipo per l'aiuto.