Dear DRE-BTE-ians,
This week we move forward to explored how data structures and programming concepts come to life through the Raspberry Pi Pico. We completed Activity 1 (Digital Output), Activity 2 (Traffic Light), and Activity 3 (Digital Input), each introducing a new layer of understanding in Python programming and physical computing.
Activity 1 – Digital Output: Lighting Up with Variables
We began with the most fundamental task, turning an LED ON and OFF.
Through this, students learned:
-
-
How to define and use variables to store pin numbers and LED states
-
How data types like integers and booleans control hardware behavior
-
How to send output signals using the
Pin()function and.on()/.off()commands
-
This activity established the foundation for understanding how code interacts with physical devices. Also, we make use of Wokwi online simulator, which is good especially in learning the basic concepts.









Activity 2 – Traffic Light Simulation: Learning Data Structures
Next, we built a traffic light simulation using three LEDs (Red, Yellow, Green).
Here, students experimented with different data structures to organize and control multiple outputs:
-
-
-
Lists (
[]) to store LED pins in a sequence -
Tuples (
()) for fixed sets of pins -
Dictionaries (
{}) to label LEDs for clarity ("R": 14, "Y": 13, "G": 12)
-
-
They also explored how to simplify code using loops and sleep statements to manage timing:
This hands-on activity demonstrated how data organization directly impacts code simplicity and readability.
Activity 3 – Digital Input: Reading from Buttons and Switches
The third activity introduced digital input, connecting push buttons and slider switches to the Raspberry Pi Pico.
Students learned to:
-
-
-
Read input values (
0or1) -
Use conditional statements (
if/else) to make the LED respond to user actions -
Understand Boolean logic and how it drives interactivity in real-world systems
-
-
This activity tied together input → process → output, emphasizing the logic flow that underpins all embedded systems.




Through these activities, you’ve not only focued on the essential coding techniques but also explored core data structures that make programs efficient and scalable. Understanding how lists, tuples, and dictionaries manage data sets the stage for more complex IoT and sensor-based applications in upcoming sessions.
Next week, we’re having Midterm Test =).
We’ll continue building upon these concepts as we move toward conditional programming and sensor integration, after the midterm break. Great work everyone — keep experimenting, debugging, and learning by doing!
