<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>GoBadge | Go Education Project</title><link>https://goeducation.net/docs/gobadge/</link><atom:link href="https://goeducation.net/docs/gobadge/index.xml" rel="self" type="application/rss+xml"/><description>GoBadge</description><generator>HugoBlox Kit (https://hugoblox.com)</generator><language>en-us</language><image><url>https://goeducation.net/media/logo.svg</url><title>GoBadge</title><link>https://goeducation.net/docs/gobadge/</link></image><item><title>Step-by-step Tutorial</title><link>https://goeducation.net/docs/gobadge/tutorial/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://goeducation.net/docs/gobadge/tutorial/</guid><description>
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;Visit the
to download the example code and get the latest version.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="what-you-need"&gt;What you need&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;- GoBadge aka Adafruit PyBadge
- Personal computer with Go 1.18/1.19 and TinyGo installed, and a serial port.
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="installation"&gt;Installation&lt;/h2&gt;
&lt;h3 id="go"&gt;Go&lt;/h3&gt;
&lt;p&gt;If somehow you have not installed Go on your computer already, you can download it here:&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;Now you are ready to install TinyGo.&lt;/p&gt;
&lt;h3 id="tinygo"&gt;TinyGo&lt;/h3&gt;
&lt;p&gt;Follow the instructions here for your operating system:&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;h2 id="connecting-the-gobadge-to-your-computer"&gt;Connecting the GoBadge to your computer&lt;/h2&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="welcome.jpg" alt="welcome to gopher badge" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;Plug the GoBadge into your computer using a USB cable. There may be one provided in your starter kit.&lt;/p&gt;
&lt;p&gt;Make sure that the GoBadge is on.&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="on_off.jpg" alt="on off switch" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 id="running-the-code"&gt;Running the code&lt;/h2&gt;
&lt;p&gt;The TinyGo programs will run directly on the GoBadge&amp;rsquo;s microcontroller. The procedure is basically:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Edit your TinyGo program.&lt;/li&gt;
&lt;li&gt;Compile and flash it to your GoBadge.&lt;/li&gt;
&lt;li&gt;The program executes from the GoBadge. You can disconnect the GoBadge from your computer (plug it into a battery, if it isn&amp;rsquo;t already), the program executes directly on the microcontroller.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let&amp;rsquo;s get started!&lt;/p&gt;
&lt;h2 id="code"&gt;Code&lt;/h2&gt;
&lt;h3 id="step0go---built-in-led"&gt;step0.go - Built-in LED&lt;/h3&gt;
&lt;p&gt;This tests that you can compile and flash your PyBadge with TinyGo code, by blinking the built-in LED (it&amp;rsquo;s on the back).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;tinygo flash -target gobadge ./step0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="getting_flashed.jpg" alt="flashing the board" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;Once the PyBadge is flashed correctly, the built-in LED labeled &amp;ldquo;D13&amp;rdquo; (on the back) should start to turn on and off once per second. Now everything is setup correctly and you are ready to continue.&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;
&lt;img alt="step 0"
srcset="https://goeducation.net/docs/gobadge/tutorial/step0_hu_e08f6531b8b3b35c.webp 320w, https://goeducation.net/docs/gobadge/tutorial/step0_hu_c772fec1fe2e63c8.webp 480w, https://goeducation.net/docs/gobadge/tutorial/step0_hu_720f1df1a3acbd33.webp 500w"
sizes="(max-width: 480px) 100vw, (max-width: 768px) 90vw, (max-width: 1024px) 80vw, 760px"
src="https://goeducation.net/docs/gobadge/tutorial/step0_hu_e08f6531b8b3b35c.webp"
width="500"
height="401"
loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 id="step1go---built-in-led-start-button"&gt;step1.go - Built-in LED, START Button&lt;/h3&gt;
&lt;p&gt;Run the code.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;tinygo flash -target gobadge ./step1
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;When you press the START button, the built-in LED should turn on.&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;
&lt;img alt="start button"
srcset="https://goeducation.net/docs/gobadge/tutorial/step1_hu_5e593f47c7662f08.webp 320w, https://goeducation.net/docs/gobadge/tutorial/step1_hu_5bc119c117304bf.webp 480w, https://goeducation.net/docs/gobadge/tutorial/step1_hu_95e83c94b74cc314.webp 500w"
sizes="(max-width: 480px) 100vw, (max-width: 768px) 90vw, (max-width: 1024px) 80vw, 760px"
src="https://goeducation.net/docs/gobadge/tutorial/step1_hu_5e593f47c7662f08.webp"
width="500"
height="372"
loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Challenge:&lt;/em&gt;
See if you can modify
so that the LED turns on if
the &lt;em&gt;SELECT&lt;/em&gt; button is pressed instead of the &lt;em&gt;START&lt;/em&gt; button.&lt;/p&gt;
&lt;h3 id="step2go---neopixels"&gt;step2.go - Neopixels&lt;/h3&gt;
&lt;p&gt;Run the code.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;tinygo flash -target gobadge ./step2
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;
&lt;img alt="step 2 location"
srcset="https://goeducation.net/docs/gobadge/tutorial/step2_hu_a063b83c97fd3da5.webp 320w, https://goeducation.net/docs/gobadge/tutorial/step2_hu_8e2fd8ff7e2c6c4d.webp 480w, https://goeducation.net/docs/gobadge/tutorial/step2_hu_b7c6690d09cd7522.webp 500w"
sizes="(max-width: 480px) 100vw, (max-width: 768px) 90vw, (max-width: 1024px) 80vw, 760px"
src="https://goeducation.net/docs/gobadge/tutorial/step2_hu_a063b83c97fd3da5.webp"
width="500"
height="368"
loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;The 5 neopixels should light up green and red alternatively.&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img alt="step 2"
src="https://goeducation.net/docs/gobadge/tutorial/step2.gif"
loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 id="step3go---neopixels-buttons"&gt;step3.go - Neopixels, Buttons&lt;/h3&gt;
&lt;p&gt;Run the code.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;tinygo flash -target gobadge ./step3
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The 5 neopixels should light up in different colors depending on which button you press.&lt;/p&gt;
&lt;p&gt;What happens if you press more than one button at a time?&lt;/p&gt;
&lt;p&gt;try out &lt;code&gt;./step3b&lt;/code&gt;, what does it do?&lt;/p&gt;
&lt;p&gt;After deploying it should look like this:&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img alt="step3b"
src="https://goeducation.net/docs/gobadge/tutorial/step3b.gif"
loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 id="step4go---light-sensor-neopixels"&gt;step4.go - Light sensor, Neopixels&lt;/h3&gt;
&lt;p&gt;Run the code.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;tinygo flash -target gobadge ./step4
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="step5go---display"&gt;step5.go - Display&lt;/h3&gt;
&lt;p&gt;Run the code.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;tinygo flash -target gobadge ./step5/main.go
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The message &amp;ldquo;Hello Gophers!&amp;rdquo; should appear on the display.&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;
&lt;img alt="step5"
srcset="https://goeducation.net/docs/gobadge/tutorial/step5_hu_50e6cb2918f5b6d7.webp 320w, https://goeducation.net/docs/gobadge/tutorial/step5_hu_aade744ffbbc5ca7.webp 480w, https://goeducation.net/docs/gobadge/tutorial/step5_hu_d4efb7841490a557.webp 500w"
sizes="(max-width: 480px) 100vw, (max-width: 768px) 90vw, (max-width: 1024px) 80vw, 760px"
src="https://goeducation.net/docs/gobadge/tutorial/step5_hu_50e6cb2918f5b6d7.webp"
width="500"
height="348"
loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 id="step6go---display-buttons"&gt;step6.go - Display, Buttons&lt;/h3&gt;
&lt;p&gt;Run the code.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;tinygo flash -target gobadge ./step6/main.go
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;
&lt;img alt="step6"
srcset="https://goeducation.net/docs/gobadge/tutorial/step6_hu_5abc2a41dff9605d.webp 320w, https://goeducation.net/docs/gobadge/tutorial/step6_hu_1fe269e1a18d89ee.webp 480w, https://goeducation.net/docs/gobadge/tutorial/step6_hu_e98aa209a75695fa.webp 500w"
sizes="(max-width: 480px) 100vw, (max-width: 768px) 90vw, (max-width: 1024px) 80vw, 760px"
src="https://goeducation.net/docs/gobadge/tutorial/step6_hu_5abc2a41dff9605d.webp"
width="500"
height="344"
loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;The display will show some blue circle that represent that buttons on the board.
When a button is pressed a ring will be shown around its corresponding circle.&lt;/p&gt;
&lt;h3 id="step7go---display-accelerometer"&gt;step7.go - Display, Accelerometer&lt;/h3&gt;
&lt;p&gt;Run the code.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;tinygo flash -target gobadge ./step7
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;
&lt;img alt="step7"
srcset="https://goeducation.net/docs/gobadge/tutorial/step7_hu_75247a570e7611c0.webp 320w, https://goeducation.net/docs/gobadge/tutorial/step7_hu_782fa044f7a5c67f.webp 480w, https://goeducation.net/docs/gobadge/tutorial/step7_hu_e3367f7f0114ea6d.webp 500w"
sizes="(max-width: 480px) 100vw, (max-width: 768px) 90vw, (max-width: 1024px) 80vw, 760px"
src="https://goeducation.net/docs/gobadge/tutorial/step7_hu_75247a570e7611c0.webp"
width="500"
height="322"
loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;The display will show a bar for each X,Y,Z axis. Move the Pybadge to see it in action.&lt;/p&gt;
&lt;h3 id="step8go---buzzer-buttons"&gt;step8.go - Buzzer, Buttons&lt;/h3&gt;
&lt;p&gt;Run the code.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;tinygo flash -target gobadge ./step8/main.go
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Press the buttons and create your melody.&lt;/p&gt;
&lt;p&gt;Good job in completing the basic tutorials. Now can check out the more complicated
tutorials&lt;/p&gt;
&lt;h3 id="snake-game"&gt;Snake Game&lt;/h3&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;h3 id="my-name-is"&gt;My Name Is&lt;/h3&gt;
&lt;p&gt;This example display you name. Use this to make a simple name badge
&lt;/p&gt;
&lt;p&gt;Configure your name and use the awesome TinyGo-powered badge!&lt;/p&gt;
&lt;p&gt;Note:&lt;/p&gt;
&lt;p&gt;Find the different type of fonts you can use
&lt;/p&gt;</description></item></channel></rss>