BTE1522 – Innovation (Python) – Week 8 – Activity 3 GPIO LED Blinks

Hi BTE-ian,

This week, we looked into hardware construction and coding concepts, exploring fundamental skills essential for building interactive systems. The plan is o integrate GPIO (General Purpose Input/Output) pins and Python programming to control hardware components such as LEDs. 

Activity 3 – Delay, time sleep
In this activity, we look into the importance of timing in hardware control, specifically the time.sleep() function – introduce delays between actions, gaining insight into how timing impacts the behavior of hardware components. By constructing simple circuits and adjusting delay intervals, students developed a deeper understanding of the relationship between code execution and physical response.

Activity 4 – Controlling LED from Keyboard
Building upon the timing and GPIO control, we looked into interactive programming by controlling an LED using keyboard input. Conditional statements and event handling techniques, are applied, to manipulate the LED’s state based on user commands. This activity encourages students to explore the concept of user-driven interaction, laying the foundation for more complex control schemes in future projects.

Challenge: Incorporating LED Output into the Slider Game:
Towards the end, students were tasked with enhancing their Slider Game project by integrating LED output, aiming at synchronizing LED behavior with game events, such as player collisions and game over conditions. Through creative problem-solving and iterative development, students aimed to create an immersive gaming experience where LED feedback enhances player engagement and provides real-time feedback.

Learning Outcomes:

  1. Understanding of basic hardware construction and GPIO control.
  2. Proficiency in controlling hardware components through Python code.
  3. Application of conditional statements and event handling in interactive programming.
  4. Integration of hardware output (LEDs) with software applications for enhanced user experience.