To test servo motor using Raspberry Pi Pico
Required Components
- Servo motor (5V) _ 1 no
- Raspberry Pi Pico board _ 1 no
- Connecting wires _ 1 set
Circuit
Steps
- Make sure the components are working properly.
- Connect Raspberry Pi Pico board VBus and GND pin to the servo motor by using wires.
- Connect servo motor data pin to the Raspberry Pi Pico pin GP15.
- Check the Arduino program.
- Check the circuit connections.
- Run the Arduino program.
Arduino Program
#include<Servo.h>
Servo servo1;
void setup( )
{
servo1.attach(15);
}
void loop( )
{
servo1.write(0);
delay(1000);
servo1.write(90);
delay(1000);
servo1.write(180);
delay(1000);
}