{"id":120,"date":"2024-11-26T02:25:13","date_gmt":"2024-11-26T07:25:13","guid":{"rendered":"https:\/\/wp.stgeorges.bc.ca\/aidenh\/?p=120"},"modified":"2025-04-08T04:33:22","modified_gmt":"2025-04-08T08:33:22","slug":"delving-in-the-world-of-robotics","status":"publish","type":"post","link":"https:\/\/wp.stgeorges.bc.ca\/aidenh\/2024\/11\/26\/delving-in-the-world-of-robotics\/","title":{"rendered":"Delving in the World of Robotics &#8211; Intro Post 3"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I&#8217;m Aiden and let me introduce you to my Robotics assignment in my Fusion 10 program.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"576\" height=\"1024\" src=\"https:\/\/wp.stgeorges.bc.ca\/aidenh\/wp-content\/uploads\/sites\/12\/2024\/11\/fusion-one-robotics-576x1024.jpg\" alt=\"\" class=\"wp-image-143\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/aidenh\/wp-content\/uploads\/sites\/12\/2024\/11\/fusion-one-robotics-576x1024.jpg 576w, https:\/\/wp.stgeorges.bc.ca\/aidenh\/wp-content\/uploads\/sites\/12\/2024\/11\/fusion-one-robotics-169x300.jpg 169w, https:\/\/wp.stgeorges.bc.ca\/aidenh\/wp-content\/uploads\/sites\/12\/2024\/11\/fusion-one-robotics-768x1365.jpg 768w, https:\/\/wp.stgeorges.bc.ca\/aidenh\/wp-content\/uploads\/sites\/12\/2024\/11\/fusion-one-robotics-864x1536.jpg 864w, https:\/\/wp.stgeorges.bc.ca\/aidenh\/wp-content\/uploads\/sites\/12\/2024\/11\/fusion-one-robotics.jpg 1148w\" sizes=\"auto, (max-width: 576px) 100vw, 576px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This one is Example 02 from the Starter Kit, Spaceship Interface. It turns on a green LED until the switch is pressed, where it will then blink 2 red LEDs instead.<\/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=\"fusion one robotics\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/Nu5aTBTWNUA?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<div class=\"wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-c020569f wp-block-group-is-layout-flex\">\n<p class=\"wp-block-paragraph\">The code is as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>int switchstate = 0;\n\nvoid setup() {\npinMode(3, OUTPUT);\npinMode(4, OUTPUT);\npinMode(5, OUTPUT);\npinMode(2, INPUT);\n}\nvoid loop() {\nswitchstate = digitalRead(2);\nif (switchstate == LOW) {\ndigitalWrite(3,  HIGH); \ndigitalWrite(4, LOW); \ndigitalWrite(5, LOW); \n}\nelse {\ndigitalWrite(3, LOW);  \ndigitalWrite(4,  LOW);\ndigitalWrite(5, HIGH);\n\ndelay(250);\ndigitalWrite(4,  HIGH);\ndigitalWrite(5, LOW);\ndelay(250);\n}\n}<\/code><\/pre>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">The code is pretty simple. The <em>int switchstate = 0; <\/em>sets the <em>switchstate <\/em>variable to 0. The <em>void setup()<\/em> sets the pins on the Arduino Uno microcontroller to their respective input and outputs. The <em>void loop()<\/em> then sets the <em>switchstate <\/em>to <em>digitalRead(2),<\/em> which reads the voltage of the switch, and <em>if (switchstate == LOW)<\/em> (button not pressed), <em>digitalWrite(3, HIGH)<\/em> will turn pin 3 on (the green LED) and <em>digitalWrite(4, LOW); digitalWrite(5, LOW)<\/em> will keep pins 4 and 5 off (the red LEDs). Else, pin 3 turns off and pins 4 and 5 turn on. <em>delay(250);<\/em> is used to set the interval between the blinks. <em>digitalWrite(4, HIGH); digitalWrite(5, LOW); <\/em>is the code for the blinking.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This project was really frustrating. It had taken me a long time in this project and I struggled to troubleshoot why the thing didn&#8217;t work, even though I was following the book closely. I had originally started with Starter Kit 03: Love-O-Meter, but that failed horribly and wasted a large chunk of my time, so I scrapped it and started a new one.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/cdn.sparkfun.com\/assets\/3\/d\/f\/a\/9\/518c0b34ce395fea62000002.jpg\" alt=\"\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">One of the problems I encountered in this project was putting the LEDs on the wrong side of the breadboard. The Arduino breadboard consists of many thin metal lines that lie under the holes. These lines conduct electricity around the circuit. I had put the LEDs on column E instead of F, so the gap could not conduct the electricity and the LEDs did not light up.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This project taught me some basic Arduino robotics and the frustration that comes with it. I felt like pulling my hair out during parts of this project. Now if you&#8217;ll excuse me, I&#8217;m gonna take a break.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Aiden<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m Aiden and let me introduce you to my Robotics assignment in my Fusion 10 program. This one is Example 02 from the Starter Kit, Spaceship Interface. It turns on a green LED until the switch is pressed, where it will then blink 2 red LEDs instead. The code is as follows: The code is [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-120","post","type-post","status-publish","format-standard","hentry","category-intro"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/wp.stgeorges.bc.ca\/aidenh\/wp-json\/wp\/v2\/posts\/120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.stgeorges.bc.ca\/aidenh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.stgeorges.bc.ca\/aidenh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.stgeorges.bc.ca\/aidenh\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.stgeorges.bc.ca\/aidenh\/wp-json\/wp\/v2\/comments?post=120"}],"version-history":[{"count":4,"href":"https:\/\/wp.stgeorges.bc.ca\/aidenh\/wp-json\/wp\/v2\/posts\/120\/revisions"}],"predecessor-version":[{"id":224,"href":"https:\/\/wp.stgeorges.bc.ca\/aidenh\/wp-json\/wp\/v2\/posts\/120\/revisions\/224"}],"wp:attachment":[{"href":"https:\/\/wp.stgeorges.bc.ca\/aidenh\/wp-json\/wp\/v2\/media?parent=120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.stgeorges.bc.ca\/aidenh\/wp-json\/wp\/v2\/categories?post=120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.stgeorges.bc.ca\/aidenh\/wp-json\/wp\/v2\/tags?post=120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}