I'm trying to run any of the approved examples using the servo.h library on my Giga R1 without any luck. Ultimately I'm trying to run 12 dc motors via electronic speed controllers so the convenience of a library that can handle up to 12 outputs would be super helpful.
running the stock "p05_ServoMoodIndicator.ino" yields"
/run/arduino/sketches/p05_ServoMoodIndicator/p05_ServoMoodIndicator.ino:23:7: error: no matching function for call to 'Servo::Servo()'
Servo myServo; // create a servo object
^~~~~~~
In file included from /run/arduino/sketches/p05_ServoMoodIndicator/p05_ServoMoodIndicator.ino:21:0:
/var/run/arduino/directories-user/libraries/vovagorodok_Servo/src/Servo.h:7:5: note: candidate: Servo::Servo(uint8_t, int, bool)
Servo(uint8_t pin, int degree, bool activeState = HIGH);
^~~~~
/var/run/arduino/directories-user/libraries/vovagorodok_Servo/src/Servo.h:7:5: note: candidate expects 3 arguments, 0 provided
/var/run/arduino/directories-user/libraries/vovagorodok_Servo/src/Servo.h:4:7: note: candidate: constexpr Servo::Servo(const Servo&)
class Servo
^~~~~
/var/run/arduino/directories-user/libraries/vovagorodok_Servo/src/Servo.h:4:7: note: candidate expects 1 argument, 0 provided
/var/run/arduino/directories-user/libraries/vovagorodok_Servo/src/Servo.h:4:7: note: candidate: constexpr Servo::Servo(Servo&&)
/var/run/arduino/directories-user/libraries/vovagorodok_Servo/src/Servo.h:4:7: note: candidate expects 1 argument, 0 provided
/run/arduino/sketches/p05_ServoMoodIndicator/p05_ServoMoodIndicator.ino: In function 'void setup()':
/run/arduino/sketches/p05_ServoMoodIndicator/p05_ServoMoodIndicator.ino:30:11: error: 'class Servo' has no member named 'attach'
myServo.attach(9); // attaches the servo on pin 9 to the servo object
^~~~~~
/run/arduino/sketches/p05_ServoMoodIndicator/p05_ServoMoodIndicator.ino: In function 'void loop()':
/run/arduino/sketches/p05_ServoMoodIndicator/p05_ServoMoodIndicator.ino:48:11: error: 'class Servo' has no member named 'write'
myServo.write(angle);
^~~~~
Multiple libraries were found for "Servo.h"
Used: /run/arduino/directories-data/internal/vovagorodok_Servo_1.0.0_6961a255e787e1c0
Not used: /run/arduino/directories-data/internal/RokitSmart_1.0.9_451c193f0f6c26e0
Not used: /run/arduino/directories-data/internal/BlenderServoAnimation_2.0.0_5fd39f5148e267f5
Not used: /run/arduino/directories-data/internal/MicrobitV2-HHS_0.1.6_4f380786f4a02bbb
Not used: /run/arduino/directories-data/internal/SimpleServoESP32_1.0.0_8e1027ae8a58e3ff
Not used: /run/arduino/directories-data/internal/evive_2.0.3_5f55f42e94b8dc1c
Not used: /run/arduino/directories-data/internal/ServoESP32Fix_1.1.2_d30b9325b7256e15
Not used: /run/arduino/directories-data/internal/Printoo_Library_1.0.2_ee278294e95a24f4
Not used: /run/arduino/directories-data/internal/ServoESP32_1.1.1_adfebfc90bcf11c8
Not used: /run/arduino/directories-data/internal/Servo_1.2.2_4ee28ec4ddbfa791
Not used: /run/arduino/directories-data/internal/XMC_Servo_1.0.1_7e39eb80a52a9d09
Not used: /run/arduino/directories-data/internal/ESP32_ESP32S2_AnalogWrite_5.0.2_3c1a2555dcb3b0e6
Hi, which of the multitude of servo libraries you have installed are you hoping to use? The IDE has chosen vovagorodok_Servo but the Arduino example you are trying to compile will not work with that library without changes. Uninstall all bar Servo_1.2.2 if you want that example to compile.
Thanks! I also just learned that with the cloud app you cannot delete .h files from sketches. You need to create a new sketch and get the correct .h file in there. I will see how it turns out.
Hi @underconstrained. Every one of the thousands of libraries in the Arduino Library Manager are pre-installed in Arduino Cloud.
This is very convenient because it means you don't need to worry about installing or updating the libraries. However, it can sometimes cause issues. The problem is that, for any common filename used in an #include directive in your sketch program, there may be multiple libraries that contain a file of that name. When this occurs, Arduino Cloud attempts to automatically pick the best library to use when compiling your sketch. It is pretty smart about this, but unfortunately doesn't always make the right choice.
This is a case where Arduino Cloud picked a different library than the one your sketch was meant to use.
I'll provide instructions you can follow to configure the library that should be used when compiling your sketch in Arduino Cloud:
Click the following link to open the list of your Arduino Cloud sketches in the web browser: https://app.arduino.cc/sketches
Select the sketch for which you want to configure the library to be used.
The sketch will open in Arduino Cloud Editor.
If you are using an example sketch, click the sketch name at the top of the Arduino Cloud Editor page, then select "Save in you sketches" from the menu that opens.
Click the icon that looks like shelved books ("Libraries") in the bar on the left side of the Cloud Editor page.
The "Libraries" panel will open.
Type servo in the "Search libraries" field near the top of the panel.
You will see text under the "Search libraries" field:
Show libraries for: <board name>
(where <board name> is the name of the board you have selected in Cloud Editor)
Click the board name in that text.
The text will now change to:
Show libraries for: ALL DEVICES
Find the entry for the "Servo" library in the search results.
You will see a drop-down menu in the library's entry. Click on it.
The menu will open.
Select "v. 1.2.2" from the menu. You must select the "v. 1.2.2" menu item, not the "Latest (1.2.2)" item at the top of the menu.
The menu will close.
Click the "INCLUDE" button in the "Servo" library entry. ⓘ Clicking this button configures the sketch to use the "Servo" library, at the specific version selected from the menu.
You will now see a "Library already included" notification. This is expected and doesn't indicate any problem.
Now try compiling or uploading the sketch again. This time the expected library should be used and the compilation should be successful.
Note that the library configuration achieved via the above procedure was specific to the sketch you had open in Arduino Cloud Editor. If you want to make the same configuration for another sketch, open it in Cloud Editor and repeat the procedure.
The above procedure configured the sketch to always use the version you selected from the menu. Important enhancements or bug fixes might be made to the library in future releases of the library, so it is a good idea to periodically check for the availability of newer versions. You can repeat the procedure above to configure the sketch to use a different version of the library.
Please let me know if you have any questions or problems while following those instructions.
I have the same problems. Following your instructions, I end up with this:
WARNING: library Servo claims to run on avr, megaavr, sam, samd, nrf52, stm32f4, mbed, mbed_nano, mbed_portenta, mbed_rp2040, renesas, renesas_portenta, renesas_uno architecture(s) and may be incompatible with your current board which runs on mbed_giga architecture(s).
Sketch uses 413348 bytes (21%) of program storage space. Maximum is 1966080 bytes.
Global variables use 120816 bytes (23%) of dynamic memory, leaving 402808 bytes for local variables. Maximum is 523624 bytes.
After that, I get a successfull upload. I guess everything is ok.
Hi @Johan_Ha. The library developer may define a list of supported architectures in the library's metadata. This list is manually maintained, so it might occur that the developer remember to add some compatible architectures. In this case, the "may be incompatible with your current board" warning will be shown spuriously.
The developers have explicitly specified compatibility with the mbed_portenta architecture of the Portenta H7, which uses the same STM32H747XI microcontroller and Mbed OS-based Arduino core as the GIGA R1 WiFi. So I think there is a good chance that the GIGA R1 WiFi is just as compatible with the library, but the developers just forgot to add the mbed_giga architecture to the library's metadata.