The world is digital, but life is analog..
In Week 2 of the BTE1522 DRE2213 course, the focus was on fundamental programming concepts, specifically data types and control statements in Python. These are critical building blocks for developing logical structures within any programming language and are key to enabling students to design functional applications.
int
): Whole numbers, like 1, 2, or 100.float
): Numbers with decimal points, like 3.14 or 5.0.str
): Text data, enclosed in quotes, like “Hello, World!”.bool
): True or False values, used for conditional logic.Activity 1-3: Player Creation and Movement
Students applied their understanding of data types and control statements through practical coding exercises. In Activities 1-3, they created a basic player character and programmed its movement across the game window.
The coding exercise allowed students to implement:
Moving to the Second Phase – Five Challenges
After completing the initial activities, students moved to a more challenging phase involving code modifications and analysis. They were tasked with modifying and analyzing code to address five distinct challenges, each designed to deepen their understanding of data types and control statements.
Challenge 1: Modify Movement with Control Statements
Objective – Students were introduced to control statements such as if, elif, and else. They modified the code to allow the player to move based on specific conditions, such as different key presses resulting in different player actions.
Challenge 2: Boundary Control with Conditional Statements
Objective – In this challenge, students explored boundary detection using if and else statements. The goal was to prevent the player from moving outside the game window. This reinforced their understanding of how conditions can control flow in a program.
Challenge 3: Change Player’s Color with Data Types
Objective – Students were introduced to the concept of variables and data types such as lists and tuples. The challenge was to change the player’s color based on certain conditions, like the player reaching specific coordinates.
Challenge 4: Score and Time Tracking with Variables
Objective – Students explored the use of variables and loops to add a scoring system and time limit. They learned how to create a variable that increments when the player performs specific actions and how to manage game time using a while loop.
Challenge 5: Advanced Activity: Collision Detection
Objective – The final challenge involved practicing control structures and Boolean data types to detect when the player collided with the screen edges. This challenge required students to think critically about game dynamics and how to implement collision logic.
Pedagogical Approaches in the Exercise
To ensure a thorough understanding, two pedagogical approaches were used throughout the five challenges:
Week 2 was an essential part of the course as it introduced fundamental programming concepts like data types and control statements in Python. Through interactive activities and challenges, students not only learned to implement these concepts but also developed problem-solving skills by engaging in code modification and analysis. These exercises laid a strong foundation for the more advanced topics to come in the course.
Nurul Oct 15th
DRE2213
BTE1522
A 4-days workshop crafted for academicians from Polytechnics Malaysia.
I recently conducted a comprehensive 4-day workshop to introduce participants (among academicians from Polytechnics in Malaysia) to both fundamental and advanced topics, offering hands-on activities that showcased the powerful applications of AI, electronics, and programming.
Thank you Pn Azlyn for coordinating the communication and facilitating the process :).
Below is a summary of the activities we conducted over the course of this workshop.
Day 1 Foundations of AI, Python, and Raspberry Pi
The workshop kicked off with an introduction to AI and the Raspberry Pi microprocessor. We started with a fun ice-breaker activity, Introduction BINGO, where participants got to know each other. Afterward, we delved into the fundamental concepts of hardware and electronic components, ensuring everyone was comfortable with the physical aspects of working with a Raspberry Pi.
Key Topics Covered –
Day 2 Control Statements, Communication, and Sensors
We began Day 2 by introducing participants to Python control statements, providing the backbone for controlling the hardware components with Python scripts. This session included practical activities focused on various communication protocols like I2C and SPI, commonly used for sensor integration.
Key Activities and Topics –
Hands-on Activities –
Day 3 Exploring Sensors and Camera Controls
On Day 3, we moved into more complex sensor and camera integration. Participants worked hands-on with various sensors to collect and process real-world data.
Key Sensors Covered –
Key Highlights
Looking Forward
This workshop is just the beginning. The potential of Raspberry Pi combined with Python programming offers limitless possibilities, from creating AI-powered projects to building real-world applications. Participants left equipped with the skills and confidence to continue their journey in AI and embedded systems development.
Conclusion
In just four days, participants transitioned from having no experience with Raspberry Pi or Python to developing their own AI-based projects. This course laid a strong foundation for understanding hardware, software, and AI in a hands-on, engaging way. The combination of sensors, control statements, and camera-based projects showcased the immense power of integrating AI and Python with Raspberry Pi.
Stay tuned for more workshops that push the boundaries of AI and embedded programming!
I hope everyone had enjoyed the course as much as I did in facilitating it.
Nurul (Oct 3rd, 2024)
Day 4
Day 3
Day 2
Day 1
Misc