week 4. Embedded Programming¶
Group Assignment¶
This week I worked on embedded programming. I learned how to program a microcontroller and test basic functionality.
Tools¶
- Arduino IDE
- Seeed Studio XIAO RP2040
- USB cable
- Computer
Individual Assignment¶
During the group work, we explored different microcontrollers and their capabilities. I chose the Seeed Studio XIAO RP2040 because of its compact size and compatibility with Arduino IDE.
I selected the XIAO RP2040 because it is small, easy to use, and suitable for future project integration.

- Downloaded and installed Arduino IDE.
- Opened the Seeed Studio website.
- Copied the board manager URL.


- Added the URL into Arduino IDE preferences.
- Installed the XIAO RP2040 board package.


- Connected the XIAO RP2040 to the computer.
- Selected the correct board from the menu.
- Selected the COM port.
Before making connections, I reviewed the RP2040 pinout diagram to better understand the pin functions and avoid incorrect wiring.

Programming¶
After studying the RP2040 pinout, I created a simple program to test input reading from pin D0.
The code initializes serial communication and sets pin D0 as an input. The program continuously reads the digital state of the pin and prints “CLOSED” or “OPEN” in the Serial Monitor depending on the input signal. - Serial.begin(9600) initializes serial communication. - pinMode(D0, INPUT) sets pin D0 as input. - digitalRead(D0) reads the pin state. - Serial.println outputs the result to Serial Monitor.
This test helped me understand how to read digital input signals and verify hardware connections.

Sensor Testing¶
I tested the sensor by monitoring its digital input signal. When motion was detected, the input state changed to HIGH and the system printed “CLOSED”. When no motion was detected, the input remained LOW and the system printed “OPEN”.

This experiment helped me understand how sensor input can control program behavior.
Result¶
Successfully programmed the XIAO RP2040 to read sensor input and display OPEN/CLOSED status in Serial Monitor.
Reflection¶
This week helped me understand embedded programming workflow, including hardware setup and reading digital input signals.
I learned how sensor input can control program behavior.
In future work, I want to explore more advanced embedded programming