Micro Servo Motor

This guide will show you how use and control the micro servos connected to the Servo port of the Maker Uno RP2040. The signal pins of the on-board Servo port are GP14, GP15, GP16, and GP17. The voltage of the servos depends on the power supply voltage.

 

1. Connect a micro servo motor to one of the Servo ports. For example, you can connect a SG90 micro servo to the S1 port on Maker Uno RP2040

2. While your Maker Uno RP2040 is connected to your computer, open your editor software (for example Thonny). Select the code.py file in your drive.

 

3. Copy and paste the following code to your editor.

 

4. Flash the codes to your Maker Uno RP2040. The expected outcome is for the servo motor to move back and forth in a sweeping motion, going from 0° to 180° to 90°, and then back to 0°, repeating this sequence continuously.

Library file(s) required:
    adafruit_motor (file) : motor.mpy, servo.mpy, stepper.mpy

If you don't have this file in your computer, download the lib bundle here and search for this file inside the "lib" folder.

 

5. You may also try to flash this code to your Maker Uno RP2040. Like the previous code, this code will program the servo to perform a 0° to 180° sweeping motion. However, this time, we can manipulate the speed by adjusting the sleep time between each angle.

Hardware Components

x 1 unit(s)