{"id":212,"date":"2026-03-13T19:38:06","date_gmt":"2026-03-13T19:38:06","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/g_cruz\/?p=212"},"modified":"2026-03-13T19:38:06","modified_gmt":"2026-03-13T19:38:06","slug":"the-original-rises-again","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/g_cruz\/2026\/03\/13\/the-original-rises-again\/","title":{"rendered":"The Original Rises again"},"content":{"rendered":"\n<p>The original &#8220;Child,&#8221; which was the Arduino Uno I used MUCH earlier has been brought back up for a new project.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/*\nThis will be my iteration of an ultrasonic distance sensor sending a signal and determining how close something is via an RGB LED and a peizo\n*\/\n\n#include &lt;Ultrasonic.h>\n\nUltrasonic ultrasonic(12,13);\nint distance;\n\nconst int redPin = 3;\nconst int greenPin = 5;\nconst int bluePin = 6;\n\nvoid setup() {\n  Serial.begin(9600);\n}\n\nvoid loop() {\n distance = ultrasonic.read();\n\n Serial.print(\"Distance is CM: \");\n Serial.println(distance);\n delay(500);\n}<\/code><\/pre>\n\n\n\n<p>I know it&#8217;s unprofessional to just DUMP my code, BUT this is being done on a separate device, so I have to type it WORD FOR WORD.<\/p>\n\n\n\n<p>if you know &#8220;import&#8221; in Python, then &#8220;#include &lt;library.h>&#8221; is the same thing<\/p>\n\n\n\n<p>Right now, most of this code only initializes. The rest of it is for the Ultrasonic Distance Sensor (UDS). <\/p>\n\n\n\n<p>Quickfire now: &#8220;distance&#8221; just stores the distance from the UDS, &#8220;Serial.print()&#8221; returns text in the serial monitor and &#8220;Serial.println()&#8221; does the same without making a new line, &#8220;delay()&#8221; is a delay, and GOD FORBID should you forget the semicolon (;) in ANY form of C++.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The original &#8220;Child,&#8221; which was the Arduino Uno I used MUCH earlier has been brought back up for a new project. I know it&#8217;s unprofessional to just DUMP my code, BUT this is being done on a separate device, so I have to type it WORD FOR WORD. if you know &#8220;import&#8221; in Python, then [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-212","post","type-post","status-publish","format-standard","hentry","category-progress"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/g_cruz\/wp-json\/wp\/v2\/posts\/212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/g_cruz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/g_cruz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/g_cruz\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/g_cruz\/wp-json\/wp\/v2\/comments?post=212"}],"version-history":[{"count":1,"href":"https:\/\/theroyalscode.com\/students\/g_cruz\/wp-json\/wp\/v2\/posts\/212\/revisions"}],"predecessor-version":[{"id":213,"href":"https:\/\/theroyalscode.com\/students\/g_cruz\/wp-json\/wp\/v2\/posts\/212\/revisions\/213"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/g_cruz\/wp-json\/wp\/v2\/media?parent=212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/g_cruz\/wp-json\/wp\/v2\/categories?post=212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/g_cruz\/wp-json\/wp\/v2\/tags?post=212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}