Error compiling for board Arduino Nano 33 BLE

Hello, I’m rather new to the Arduino,
I am having a sequence of problems That I haven’t been able to overcome. For a project I am to install the Sweeper program and run it on my Arduino Nano 33 BLE and make the motor sweep. Doing so I am receiving this:

Arduino: 1.8.13 (Windows Store 1.8.42.0) (Windows 10), Board: “Arduino Nano 33 BLE”

WARNING: library Servo claims to run on avr, megaavr, sam, samd, nrf52, stm32f4, mbed architecture(s) and may be incompatible with your current board which runs on mbed_nano architecture(s).

C:\Users\Black\Documents\Arduino\libraries\Servo\src\mbed\Servo.cpp: In member function ‘void ServoImpl::start(uint32_t)’:

C:\Users\Black\Documents\Arduino\libraries\Servo\src\mbed\Servo.cpp:25:66: warning: ‘void mbed::TickerBase::attach(Mbed_F&&, float) [with Mbed_F = mbed::Callback<void()>]’ is deprecated: Pass a chrono duration, not a float second count. For example use 10ms rather than 0.01f. [since mbed-os-6.0.0] [-Wdeprecated-declarations]

   ticker.attach(mbed::callback(this, &ServoImpl::call), 0.02f);

                                                              ^

In file included from C:\Users\Black\Documents\ArduinoData\packages\arduino\hardware\mbed_nano\2.0.0\cores\arduino/mbed/mbed.h:83:0,

             from C:\Users\Black\Documents\ArduinoData\packages\arduino\hardware\mbed_nano\2.0.0\cores\arduino/mbed.h:14,

             from C:\Users\Black\Documents\Arduino\libraries\Servo\src\mbed\Servo.cpp:5:

C:\Users\Black\Documents\ArduinoData\packages\arduino\hardware\mbed_nano\2.0.0\cores\arduino/mbed/drivers/include/drivers/Ticker.h:92:10: note: declared here

 void attach(F &&func, float t)

      ^~~~~~

C:\Users\Black\Documents\Arduino\libraries\Servo\src\mbed\Servo.cpp: In member function ‘void ServoImpl::call()’:

C:\Users\Black\Documents\Arduino\libraries\Servo\src\mbed\Servo.cpp:29:80: warning: ‘void mbed::TickerBase::attach(Mbed_F&&, float) [with Mbed_F = mbed::Callback<void()>]’ is deprecated: Pass a chrono duration, not a float second count. For example use 10ms rather than 0.01f. [since mbed-os-6.0.0] [-Wdeprecated-declarations]

     timeout.attach(mbed::callback(this, &ServoImpl::toggle), duration / 1e6);

                                                                            ^

In file included from C:\Users\Black\Documents\ArduinoData\packages\arduino\hardware\mbed_nano\2.0.0\cores\arduino/mbed/mbed.h:83:0,

             from C:\Users\Black\Documents\ArduinoData\packages\arduino\hardware\mbed_nano\2.0.0\cores\arduino/mbed.h:14,

             from C:\Users\Black\Documents\Arduino\libraries\Servo\src\mbed\Servo.cpp:5:

C:\Users\Black\Documents\ArduinoData\packages\arduino\hardware\mbed_nano\2.0.0\cores\arduino/mbed/drivers/include/drivers/Ticker.h:92:10: note: declared here

 void attach(F &&func, float t)

      ^~~~~~

libraries\Servo\mbed\Servo.cpp.o: In function `Servo::attach(int, int, int)’:

C:\Users\Black\Documents\Arduino\libraries\Servo\src\mbed/Servo.cpp:65: undefined reference to `digitalPinToPinName(unsigned char)’

collect2.exe: error: ld returned 1 exit status

Multiple libraries were found for “Servo.h”

Used: C:\Users\Black\Documents\Arduino\libraries\Servo

Not used: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\libraries\Servo

exit status 1

Error compiling for board Arduino Nano 33 BLE.

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

The code I am using is from this link: https://www.arduino.cc/en/Tutorial/LibraryExamples/Sweep

I am not sure if it is the type of board I am using or anything. Besides this I have also encountered another error were it says it fails to upload to the Arduino board if I did get it to work.

Different libraries may only work on certain boards as was indicated by one of your error messages.
Best solution is to find a library that was designed for that board and rule out that issue first as it may also cause other issues.
If you have the skills to modify the library yourself than that is an option.
If not them maybe a request on the relevan GIT where the library came from.

Sweep is quite an old library meant for older devices.
You may also come across voltage and current issues as it is not recommended to drive motors or steppers etc from the Arduino’s supply system because of the current limitations which many people often come up against.

That’s a good insight, Do you know any modern codes and library that may work?

Sorry no I am afraid I don’t.

Sometimes it is a matter of trial and error.
Quite often reading the library specifications can be of use before you try.
maybe somebody else has a suggestion ?

Hi @personnnnn123121 It seems that an incompatibility was introduced in the 2.0.0 release of the Arduino Mbed OS board platform of the Nano 33 BLE.

You can resolve this by using the previous version. Please try this:

  1. Select Tools > Board > Boards Manager from the Arduino IDE"s menus.
  2. Wait for the update to finish.
  3. Scroll down through the list of available boards platforms until you see “[Deprecated - Please install standalone packages] Arduino Mbed OS Boards”. Click on it.
  4. Click the “Install” button.
  5. Wait for the installation to finish.
  6. Click the “Close” button.
  7. Select Tools > Board > Arduino Mbed OS Boards (nRF52840 / STM32H747 > Arduino Nano 33 BLE from the Arduino IDE’s menus.

Now try compiling the Sweep sketch again.

Note that, due to the current unique circumstances where the Arduino Mbed OS Boards platform was split into board -specific variants, you will still have the new “Arduino Mbed OS Nano Boards” platform available under the Tools > Board menu, so you can decide when you want to use the old 1.3.2 version or the new 2.0.0 version of the boards platform at will. If you eventually decide you want to uninstall one, you can do that by clicking the “Remove” button in Boards Manager.

This is the Servo library. It has been around for a long time, but it still actively maintained as one of the cornerstones of the official Arduino firmware offerings, with support added for each new board released over the ~15 years since it was created.

The current unfortunate issue was introduced only a few weeks ago by a significant reworking of the Arduino Mbed OS Boards platform (as indicated by the major version bump from 1.3.2 to 2.0.0) to add support for the new Raspberry Pi RP2040 microcontroller.

Cheers! That did the trick, installing the 1.3.2 library made it compatible.

Ah, so they accidently made this board incompatible?

I did wonder about tagging you into this.
Those thoughts would have been a better option LOL.

That would’ve been preferred. I’m on a course and a load of students have all been confused as hell as to why we couldn’t compile hahahaha

I’m glad to hear it!

Not the board, but the “core library” that defines the standardized Arduino Language API for the board.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.