{"id":104,"date":"2024-10-23T17:42:22","date_gmt":"2024-10-23T21:42:22","guid":{"rendered":"https:\/\/wp.stgeorges.bc.ca\/joshuac\/?p=104"},"modified":"2024-10-23T17:42:22","modified_gmt":"2024-10-23T21:42:22","slug":"beginner-robotics","status":"publish","type":"post","link":"https:\/\/wp.stgeorges.bc.ca\/joshuac\/2024\/10\/23\/beginner-robotics\/","title":{"rendered":"Beginner Robotics"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Aside from the small workshop in grade 9, I have never encountered Arduino before and this is my first time working with it. Luckily the set I was given came with a manual that taught me the parts, and gave me different projects to do. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"768\" height=\"1024\" src=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/IMG_7361-768x1024.jpeg\" alt=\"\" class=\"wp-image-116\" style=\"width:401px;height:auto\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/IMG_7361-768x1024.jpeg 768w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/IMG_7361-225x300.jpeg 225w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/IMG_7361-1152x1536.jpeg 1152w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/IMG_7361-1536x2048.jpeg 1536w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/IMG_7361-scaled.jpeg 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">I decided to work on this digital hourglass project. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The first step was to connect power and ground to the breadboard<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"781\" src=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-17.png\" alt=\"\" class=\"wp-image-117\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-17.png 720w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-17-277x300.png 277w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Next was to add the resistors needed<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"725\" height=\"637\" src=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-18.png\" alt=\"\" class=\"wp-image-118\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-18.png 725w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-18-300x264.png 300w\" sizes=\"auto, (max-width: 725px) 100vw, 725px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Next we connect the rest of the wires that would create a circut through the led lights and resistors.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"597\" src=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-20.png\" alt=\"\" class=\"wp-image-120\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-20.png 720w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-20-300x249.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Then the led lights.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"724\" height=\"618\" src=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-21.png\" alt=\"\" class=\"wp-image-121\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-21.png 724w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-21-300x256.png 300w\" sizes=\"auto, (max-width: 724px) 100vw, 724px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">However, at this point I realized I was using the wrong resistors. I had to search online to match the right 220ohm resistors. This then resulted in a torturing process of removing all of the resistors and replacing them.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"714\" height=\"632\" src=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-22.png\" alt=\"\" class=\"wp-image-122\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-22.png 714w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-22-300x266.png 300w\" sizes=\"auto, (max-width: 714px) 100vw, 714px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The last part was to add a tilt switch as an addiontal function of turning off the timer. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"728\" height=\"616\" src=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-23.png\" alt=\"\" class=\"wp-image-123\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-23.png 728w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-23-300x254.png 300w\" sizes=\"auto, (max-width: 728px) 100vw, 728px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">After finishing the physical project, we move into the digital space of coding the arduino block. The manual provided a nice line by line direction of what the code&#8217;s purpose. Here&#8217;s the general flow. <\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Setup<\/strong>\n<ul class=\"wp-block-list\">\n<li>Set inputs and outputs to run the circut<br><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Loop Begins<\/strong>\n<ul class=\"wp-block-list\">\n<li>Store <code>currentTime = millis()<\/code><br><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>(Decision)<\/strong> \n<ul class=\"wp-block-list\">\n<li>Measure using the built in timer to tell if the time interval is up<\/li>\n\n\n\n<li><strong>Yes<\/strong> \u2192 Proceed to turn on the next LED<\/li>\n\n\n\n<li><strong>No<\/strong> \u2192 Skip to Step 6<br><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Turn on Current LED<\/strong>\n<ul class=\"wp-block-list\">\n<li>Reset the time interval<br><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Read Switch State<\/strong>\n<ul class=\"wp-block-list\">\n<li><code>Tell if the switch is getting tilted<\/code><br><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>(Decision)<\/strong>\n<ul class=\"wp-block-list\">\n<li>If tilting then urn off all LEDs\n<ul class=\"wp-block-list\">\n<li>Reset everything else<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>If not then Continue<br><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"968\" height=\"563\" src=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-24.png\" alt=\"\" class=\"wp-image-124\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-24.png 968w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-24-300x174.png 300w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-24-768x447.png 768w\" sizes=\"auto, (max-width: 968px) 100vw, 968px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"894\" height=\"571\" src=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-27.png\" alt=\"\" class=\"wp-image-127\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-27.png 894w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-27-300x192.png 300w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-27-768x491.png 768w\" sizes=\"auto, (max-width: 894px) 100vw, 894px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"881\" height=\"556\" src=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-26.png\" alt=\"\" class=\"wp-image-126\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-26.png 881w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-26-300x189.png 300w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-26-768x485.png 768w\" sizes=\"auto, (max-width: 881px) 100vw, 881px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s the code in action. <\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"October 23, 2024\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/vtRyF6d3E6w?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Aside from the small workshop in grade 9, I have never encountered Arduino before and this is my first time working with it. Luckily the set I was given came with a manual that taught me the parts, and gave me different projects to do. I decided to work on this digital hourglass project. The [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-104","post","type-post","status-publish","format-standard","hentry","category-mechanicsandengineering"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-json\/wp\/v2\/posts\/104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-json\/wp\/v2\/comments?post=104"}],"version-history":[{"count":3,"href":"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-json\/wp\/v2\/posts\/104\/revisions"}],"predecessor-version":[{"id":128,"href":"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-json\/wp\/v2\/posts\/104\/revisions\/128"}],"wp:attachment":[{"href":"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-json\/wp\/v2\/media?parent=104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-json\/wp\/v2\/categories?post=104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-json\/wp\/v2\/tags?post=104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}