RP2040_ISR_Servo Library

RP2040_ISR_Servo library GitHub release
arduino-library-badge

Why do we need this RP2040_ISR_Servo library

Features

This library enables you to use 1 Hardware Timer on an RP2040-based board to control up to 16 independent servo motors.


Currently supported Boards

  1. RP2040-based boards such as Nano_RP2040_Connect, RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, etc. using Arduino-mbed RP2040 core
  2. RP2040-based boards such as Nano_RP2040_Connect, RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, etc. using Earle Philhower's arduino-pico core


Changelog

Releases v1.0.0

  1. Basic 16 ISR-based servo controllers using 1 hardware timer for RP2040-based board
  2. Support to both Arduino-mbed RP2040 core and Earle Philhower's arduino-pico core

Examples:

  1. RP2040_MultipleRandomServos
  2. RP2040_MultipleServos

Example RP2040_MultipleRandomServos on Mbed RaspberryPi Pico

The following is the sample terminal output when running example RP2040_MultipleRandomServos on RaspberryPi Pico using Arduino-mbed RP2040 core to demonstrate how to control multiple Servos.

Starting RP2040_MultipleRandomServos on Mbed RaspberryPi Pico
Mbed RP2040_ISR_Servo v1.0.0
Setup OK Servo index = 0
Setup OK Servo index = 1
Setup OK Servo index = 2
Setup OK Servo index = 3
Setup OK Servo index = 4
Setup OK Servo index = 5
Servos @ 0 degree
Servos idx = 0, act. pos. (deg) = 800, pulseWidth (us) = 800
Servos idx = 1, act. pos. (deg) = 800, pulseWidth (us) = 800
Servos idx = 2, act. pos. (deg) = 800, pulseWidth (us) = 800
Servos idx = 3, act. pos. (deg) = 800, pulseWidth (us) = 800
Servos idx = 4, act. pos. (deg) = 800, pulseWidth (us) = 800
Servos idx = 5, act. pos. (deg) = 800, pulseWidth (us) = 800
Servos @ 90 degree
Servos idx = 0, act. pos. (deg) = 1625, pulseWidth (us) = 1625
Servos idx = 1, act. pos. (deg) = 1625, pulseWidth (us) = 1625
Servos idx = 2, act. pos. (deg) = 1625, pulseWidth (us) = 1625
Servos idx = 3, act. pos. (deg) = 1625, pulseWidth (us) = 1625
Servos idx = 4, act. pos. (deg) = 1625, pulseWidth (us) = 1625
Servos idx = 5, act. pos. (deg) = 1625, pulseWidth (us) = 1625
Servos @ 180 degree
Servos idx = 0, act. pos. (deg) = 2450, pulseWidth (us) = 2450
Servos idx = 1, act. pos. (deg) = 2450, pulseWidth (us) = 2450
Servos idx = 2, act. pos. (deg) = 2450, pulseWidth (us) = 2450
Servos idx = 3, act. pos. (deg) = 2450, pulseWidth (us) = 2450
Servos idx = 4, act. pos. (deg) = 2450, pulseWidth (us) = 2450
Servos idx = 5, act. pos. (deg) = 2450, pulseWidth (us) = 2450
Servos sweeps from 0-180 degress
Servos @ 0 degree
Servos idx = 0, act. pos. (deg) = 800, pulseWidth (us) = 800
Servos idx = 1, act. pos. (deg) = 800, pulseWidth (us) = 800
Servos idx = 2, act. pos. (deg) = 800, pulseWidth (us) = 800
Servos idx = 3, act. pos. (deg) = 800, pulseWidth (us) = 800
Servos idx = 4, act. pos. (deg) = 800, pulseWidth (us) = 800
Servos idx = 5, act. pos. (deg) = 800, pulseWidth (us) = 800