
git
Git is a distributed version control system that tracks changes in any set of computer files.
For this week’s assignment, I used a micro servo motor as an output device, connected to the Seeed Studio XIAO RP2040 microcontroller. Servo motors are commonly used for controlling position, making them ideal for robotics, mechanisms, and interactive movement.
Servo motors rotate to specific angles based on the width of PWM signals. They have three main connections:
I connected the SG90 servo motor to the XIAO RP2040 as follows:
Note: I used a common GND between the XIAO and the servo power supply to ensure stable signal operation.
I used the Arduino IDE to program the XIAO RP2040. The standard Servo.h
library works with the RP2040 core.
#include <Servo.h>
Servo myservo;
int pos = 0;
void setup() {
myservo.attach(D2);
}
void loop() {
for (pos = 0; pos <= 180; pos += 1) {
myservo.write(pos);
delay(15);
}
for (pos = 180; pos >= 0; pos -= 1) {
myservo.write(pos);
delay(15);
}
}
This week helped me understand how PWM works and how to control mechanical movement using output devices. The XIAO RP2040 performed well in generating consistent PWM signals for servo control. This knowledge can be applied in interactive prototypes, robotics, and simple actuated systems.