{"id":26635,"date":"2024-04-26T11:04:51","date_gmt":"2024-04-26T03:04:51","guid":{"rendered":"http:\/\/hazlina-backup-26635"},"modified":"2024-04-26T11:04:51","modified_gmt":"2024-04-26T03:04:51","slug":"bte1522-innovation-python-week-8-activity-3-gpio-led-blinks","status":"publish","type":"post","link":"\/hazlina-blog\/2024\/04\/26\/bte1522-innovation-python-week-8-activity-3-gpio-led-blinks\/","title":{"rendered":"BTE1522 \u2013 Innovation (Python) \u2013 Week 8 \u2013 Activity 3 GPIO LED Blinks"},"content":{"rendered":"<figure>Hi BTE-ian,<\/figure>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26648\" src=\"\/hazlina\/wp-content\/uploads\/2024\/04\/p9.png\" alt=\"\" width=\"856\" height=\"484\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/04\/p9.png 856w, \/hazlina\/wp-content\/uploads\/2024\/04\/p9-300x170.png 300w, \/hazlina\/wp-content\/uploads\/2024\/04\/p9-768x434.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p>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.\u00a0<\/p>\n<p>Activity 3 \u2013 Delay, time sleep<br \/>In this activity, we look into the importance of timing in hardware control, specifically the time.sleep() function &#8211; 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.<\/p>\n<p>Activity 4 \u2013 Controlling LED from Keyboard<br \/>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&#8217;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.<\/p>\n<p>Challenge: Incorporating LED Output into the Slider Game:<br \/>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.<\/p>\n<div style=\"width: 640px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-26635-1\" width=\"640\" height=\"360\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"\/hazlina\/wp-content\/uploads\/2024\/04\/WhatsApp-Video-2024-04-26-at-11.49.09.mp4?_=1\" \/><a href=\"\/hazlina\/wp-content\/uploads\/2024\/04\/WhatsApp-Video-2024-04-26-at-11.49.09.mp4\">\/hazlina\/wp-content\/uploads\/2024\/04\/WhatsApp-Video-2024-04-26-at-11.49.09.mp4<\/a><\/video><\/div>\n<p>Learning Outcomes:<\/p>\n<ol>\n<li>Understanding of basic hardware construction and GPIO control.<\/li>\n<li>Proficiency in controlling hardware components through Python code.<\/li>\n<li>Application of conditional statements and event handling in interactive programming.<\/li>\n<li>Integration of hardware output (LEDs) with software applications for enhanced user experience.<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-26649\" src=\"\/hazlina\/wp-content\/uploads\/2024\/04\/Slide32-1024x576.jpg\" alt=\"\" width=\"840\" height=\"473\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/04\/Slide32-1024x576.jpg 1024w, \/hazlina\/wp-content\/uploads\/2024\/04\/Slide32-300x169.jpg 300w, \/hazlina\/wp-content\/uploads\/2024\/04\/Slide32-768x432.jpg 768w, \/hazlina\/wp-content\/uploads\/2024\/04\/Slide32-1200x675.jpg 1200w, \/hazlina\/wp-content\/uploads\/2024\/04\/Slide32.jpg 1280w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-26650\" src=\"\/hazlina\/wp-content\/uploads\/2024\/04\/Slide33-1024x576.jpg\" alt=\"\" width=\"840\" height=\"473\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/04\/Slide33-1024x576.jpg 1024w, \/hazlina\/wp-content\/uploads\/2024\/04\/Slide33-300x169.jpg 300w, \/hazlina\/wp-content\/uploads\/2024\/04\/Slide33-768x432.jpg 768w, \/hazlina\/wp-content\/uploads\/2024\/04\/Slide33-1200x675.jpg 1200w, \/hazlina\/wp-content\/uploads\/2024\/04\/Slide33.jpg 1280w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-26651\" src=\"\/hazlina\/wp-content\/uploads\/2024\/04\/Slide34-1024x576.jpg\" alt=\"\" width=\"840\" height=\"473\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/04\/Slide34-1024x576.jpg 1024w, \/hazlina\/wp-content\/uploads\/2024\/04\/Slide34-300x169.jpg 300w, \/hazlina\/wp-content\/uploads\/2024\/04\/Slide34-768x432.jpg 768w, \/hazlina\/wp-content\/uploads\/2024\/04\/Slide34-1200x675.jpg 1200w, \/hazlina\/wp-content\/uploads\/2024\/04\/Slide34.jpg 1280w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" class=\"wp-image-26631\" src=\"\/hazlina\/wp-content\/uploads\/2024\/04\/20240426_0911459165253043770433455-1024x768.jpg\" alt=\"\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/04\/20240426_0911459165253043770433455-1024x768.jpg 1024w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_0911459165253043770433455-300x225.jpg 300w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_0911459165253043770433455-768x576.jpg 768w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_0911459165253043770433455-1200x900.jpg 1200w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_0911459165253043770433455.jpg 2000w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<p>&nbsp;<\/p>\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" class=\"wp-image-26627\" src=\"\/hazlina\/wp-content\/uploads\/2024\/04\/20240426_0936141074911092109954812-1024x768.jpg\" alt=\"\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/04\/20240426_0936141074911092109954812-1024x768.jpg 1024w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_0936141074911092109954812-300x225.jpg 300w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_0936141074911092109954812-768x576.jpg 768w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_0936141074911092109954812-1200x900.jpg 1200w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_0936141074911092109954812.jpg 2000w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<p>&nbsp;<\/p>\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" class=\"wp-image-26630\" src=\"\/hazlina\/wp-content\/uploads\/2024\/04\/20240426_1055397840367095120983166-1024x768.jpg\" alt=\"\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/04\/20240426_1055397840367095120983166-1024x768.jpg 1024w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_1055397840367095120983166-300x225.jpg 300w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_1055397840367095120983166-768x576.jpg 768w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_1055397840367095120983166-1200x900.jpg 1200w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_1055397840367095120983166.jpg 2000w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<p>&nbsp;<\/p>\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" class=\"wp-image-26628\" src=\"\/hazlina\/wp-content\/uploads\/2024\/04\/20240426_0936487333034039904266775-1024x768.jpg\" alt=\"\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/04\/20240426_0936487333034039904266775-1024x768.jpg 1024w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_0936487333034039904266775-300x225.jpg 300w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_0936487333034039904266775-768x576.jpg 768w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_0936487333034039904266775-1200x900.jpg 1200w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_0936487333034039904266775.jpg 2000w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<p>&nbsp;<\/p>\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" class=\"wp-image-26629\" src=\"\/hazlina\/wp-content\/uploads\/2024\/04\/20240426_105746_018495614105034598497-1024x768.jpg\" alt=\"\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/04\/20240426_105746_018495614105034598497-1024x768.jpg 1024w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_105746_018495614105034598497-300x225.jpg 300w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_105746_018495614105034598497-768x576.jpg 768w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_105746_018495614105034598497-1200x900.jpg 1200w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_105746_018495614105034598497.jpg 2000w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<p>&nbsp;<\/p>\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" class=\"wp-image-26633\" src=\"\/hazlina\/wp-content\/uploads\/2024\/04\/20240426_105746_02775895871104914092-1024x768.jpg\" alt=\"\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/04\/20240426_105746_02775895871104914092-1024x768.jpg 1024w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_105746_02775895871104914092-300x225.jpg 300w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_105746_02775895871104914092-768x576.jpg 768w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_105746_02775895871104914092-1200x900.jpg 1200w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_105746_02775895871104914092.jpg 2000w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<figure class=\"wp-block-video\"><\/figure>\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" class=\"wp-image-26632\" src=\"\/hazlina\/wp-content\/uploads\/2024\/04\/20240426_1059273338861796918490178-1024x768.jpg\" alt=\"\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/04\/20240426_1059273338861796918490178-1024x768.jpg 1024w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_1059273338861796918490178-300x225.jpg 300w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_1059273338861796918490178-768x576.jpg 768w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_1059273338861796918490178-1200x900.jpg 1200w, \/hazlina\/wp-content\/uploads\/2024\/04\/20240426_1059273338861796918490178.jpg 2000w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>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.\u00a0 Activity 3 \u2013 Delay, time sleepIn this activity, we look into the importance of timing &hellip; <a href=\"\/hazlina-blog\/2024\/04\/26\/bte1522-innovation-python-week-8-activity-3-gpio-led-blinks\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;BTE1522 \u2013 Innovation (Python) \u2013 Week 8 \u2013 Activity 3 GPIO LED Blinks&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[13],"class_list":["post-26635","post","type-post","status-publish","format-standard","hentry","category-information","tag-academia-python-prog"],"_links":{"self":[{"href":"\/hazlina-blog\/wp-json\/wp\/v2\/posts\/26635","targetHints":{"allow":["GET"]}}],"collection":[{"href":"\/hazlina-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"\/hazlina-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"\/hazlina-blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"\/hazlina-blog\/wp-json\/wp\/v2\/comments?post=26635"}],"version-history":[{"count":0,"href":"\/hazlina-blog\/wp-json\/wp\/v2\/posts\/26635\/revisions"}],"wp:attachment":[{"href":"\/hazlina-blog\/wp-json\/wp\/v2\/media?parent=26635"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"\/hazlina-blog\/wp-json\/wp\/v2\/categories?post=26635"},{"taxonomy":"post_tag","embeddable":true,"href":"\/hazlina-blog\/wp-json\/wp\/v2\/tags?post=26635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}