Micro Servo Motor

This guide will show you how to control the micro servo motor connected to your Robo Pico.

The figure below shows the GPIO for each of the Servo Ports.

 

1. While your Robo Pico is connected to your computer, open your editor software (for example Thonny). Select the code.py file in your drive.


2. Connect a micro servo motor to one of the servo ports. For example, a SG90 micro servo is connected to the S1 port on Robo Pico.

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

 

4. Flash the codes to your Raspberry Pi Pico / Pico W. And your CIRCUITPY drive should look like this :

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 Raspberry Pi Pico / Pico W and observe what will happen to your Raspberry Pi Pico / Pico W.

Note: The following code will program all 4 servo ports, but still applicable if you have only 1 micro servo motor connected to one of the ports.

 

Hardware Components

Robo Pico

S$21.29 S$21.29

x 1 unit(s)