Bluepill_f103c8 can't use the arduino libraries (like servo.h) in PlattformIO but it works in the arduino IDE

Aha, I suspected that.

Dependency Graph
|-- <Servo> 1.1.7 (C:\Users\Soland\.platformio\lib\Servo)

You’ve globally installed the general Arduino (AVR etc…) version of the Servo library. This will overshadow the correct Servo library from the framework.

To fix the error, please remove the Servo library from the global storage. Removing the folder C:\Users\Soland\.platformio\lib\Servo should suffice.

This is why global library dependencies are dangerous – I’d promote strict per-project library management per lib_deps without global libraries because of this.

1 Like