New Raspberry Pi Pico Package: Servo problem

The command "servo.attach (...)" brings a serious error, so that I get stuck. Is it my mistake or a problem in the new package?
Error message: 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_rp2040 architecture (s).
C: \ Users \ Rudol \ AppData \ Local \ Temp \ arduino-sketch-C759DAD50DC7C9B7659F56100C84A46A \ libraries \ Servo \ mbed \ Servo.cpp.o: In function Servo :: attach (int, int, int) ':* *d: \ 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: d: \ Arduino \ libraries \ Servo*
  • Not used: C: \ Program Files (x86) \ Arduino \ libraries \ Servo*
    Compilation error: Error: 2 UNKNOWN: exit status 1

Sketch is attached.

     include <Servo.h>
    Servo servoMain; // Define our Servo
    #define pinServo 16

    ///==== Arduino-Standard: setup() =========================
    void setup() {
      Serial.begin(38400);
      while(!Serial) delay(10);
      Serial.println("First Servo attemp with Pico mbed");
      int iResp = servoMain.attach(pinServo,560,2440);
      if (iResp == 0)
      {
        printf("Error with Servo.attach -> Stop!");
        while(true) delay(500);
      }
      servoMain.write(90);        // Servo in Grundstellung (0°)
    }

    ///==== Arduino-Standard: loop() ==========================
    void loop() {
    }

Hint!

Hi,
What controller are you writing this code for?

Thanks.. Tom.. :grinning: :+1: :coffee: :australia:

@missdrew: thats true and should be corrected.

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