<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>GopherBadge | Go Education Project</title><link>https://goeducation.net/docs/gopherbadge/</link><atom:link href="https://goeducation.net/docs/gopherbadge/index.xml" rel="self" type="application/rss+xml"/><description>GopherBadge</description><generator>HugoBlox Kit (https://hugoblox.com)</generator><language>en-us</language><image><url>https://goeducation.net/media/logo.svg</url><title>GopherBadge</title><link>https://goeducation.net/docs/gopherbadge/</link></image><item><title>Step-by-step Tutorial</title><link>https://goeducation.net/docs/gopherbadge/tutorial/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://goeducation.net/docs/gopherbadge/tutorial/</guid><description>&lt;h2 id="what-you-need"&gt;What you need&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;- Gopher Badge aka the cutest badge out there
- Personal computer with Go 1.20 and TinyGo 0.28 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-gopher-badge-to-your-computer"&gt;Connecting the Gopher badge 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 alt="welcome to gopher badge"
srcset="https://goeducation.net/docs/gopherbadge/tutorial/welcome_hu_c7acdb8185f936bc.webp 320w, https://goeducation.net/docs/gopherbadge/tutorial/welcome_hu_a31d3fb00ee653c8.webp 347w"
sizes="(max-width: 480px) 100vw, (max-width: 768px) 90vw, (max-width: 1024px) 80vw, 760px"
src="https://goeducation.net/docs/gopherbadge/tutorial/welcome_hu_c7acdb8185f936bc.webp"
width="347"
height="660"
loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;Plug the Gopher badge into your computer using a USB cable. There may be one provided in your starter kit.&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="usb"
srcset="https://goeducation.net/docs/gopherbadge/tutorial/usb_hu_2a53d584abc43809.webp 320w, https://goeducation.net/docs/gopherbadge/tutorial/usb_hu_2864d4794468476.webp 458w"
sizes="(max-width: 480px) 100vw, (max-width: 768px) 90vw, (max-width: 1024px) 80vw, 760px"
src="https://goeducation.net/docs/gopherbadge/tutorial/usb_hu_2a53d584abc43809.webp"
width="458"
height="526"
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 Gopher badge&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 Gopher badge.&lt;/li&gt;
&lt;li&gt;The program executes from the Gopher badge. You can disconnect the Gopher badge 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 Gopher badge 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 gopher-badge ./tutorial/basics/step0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Once the Gopher badge 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"
src="https://goeducation.net/docs/gopherbadge/tutorial/step0.gif"
loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 id="step1go---built-in-led-a-button"&gt;step1.go - Built-in LED, A 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 gopher-badge ./tutorial/basics/step1
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;When you press the A button, the built-in LED on the back 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="step1"
srcset="https://goeducation.net/docs/gopherbadge/tutorial/step1_hu_bf80e168bd52497.webp 320w, https://goeducation.net/docs/gopherbadge/tutorial/step1_hu_e82f4bbc1b652a45.webp 469w"
sizes="(max-width: 480px) 100vw, (max-width: 768px) 90vw, (max-width: 1024px) 80vw, 760px"
src="https://goeducation.net/docs/gopherbadge/tutorial/step1_hu_bf80e168bd52497.webp"
width="469"
height="648"
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;B&lt;/em&gt; button is pressed instead of the &lt;em&gt;A&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 gopher-badge ./tutorial/basics/step2
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The 2 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/gopherbadge/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 gopher-badge ./tutorial/basics/step3
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The 2 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/gopherbadge/tutorial/step3b.gif"
loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 id="step4go---display"&gt;step4.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 gopher-badge ./tutorial/basics/step4/
&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="step4"
srcset="https://goeducation.net/docs/gopherbadge/tutorial/step4_hu_4c1c2f2c0f83fbb1.webp 320w, https://goeducation.net/docs/gopherbadge/tutorial/step4_hu_12f3d9a7969e58f7.webp 480w, https://goeducation.net/docs/gopherbadge/tutorial/step4_hu_d47c047803db8404.webp 540w"
sizes="(max-width: 480px) 100vw, (max-width: 768px) 90vw, (max-width: 1024px) 80vw, 760px"
src="https://goeducation.net/docs/gopherbadge/tutorial/step4_hu_4c1c2f2c0f83fbb1.webp"
width="540"
height="760"
loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 id="step5go---display-buttons"&gt;step5.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 gopher-badge ./tutorial/basics/step5/
&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="step5"
srcset="https://goeducation.net/docs/gopherbadge/tutorial/step5_hu_185e17630fa1626d.webp 320w, https://goeducation.net/docs/gopherbadge/tutorial/step5_hu_b86d1ef86a2c7729.webp 480w, https://goeducation.net/docs/gopherbadge/tutorial/step5_hu_c050053f14e9d6e0.webp 525w"
sizes="(max-width: 480px) 100vw, (max-width: 768px) 90vw, (max-width: 1024px) 80vw, 760px"
src="https://goeducation.net/docs/gopherbadge/tutorial/step5_hu_185e17630fa1626d.webp"
width="525"
height="760"
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="step6go---display-accelerometer"&gt;step6.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 gopher-badge ./tutorial/basics/step6
&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/gopherbadge/tutorial/step6_hu_3d8d09f13beecc1e.webp 320w, https://goeducation.net/docs/gopherbadge/tutorial/step6_hu_c39b24ddd6f5435c.webp 454w"
sizes="(max-width: 480px) 100vw, (max-width: 768px) 90vw, (max-width: 1024px) 80vw, 760px"
src="https://goeducation.net/docs/gopherbadge/tutorial/step6_hu_3d8d09f13beecc1e.webp"
width="454"
height="628"
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 Gopher badge to see it in action.&lt;/p&gt;
&lt;h3 id="step7go---buzzer-buttons"&gt;step7.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 gopher-badge ./tutorial/basics/step7
&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;h3 id="step8go---buttons-usb-midi-interface"&gt;step8.go - Buttons, USB midi interface&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 gopher-badge ./tutorial/basics/step8
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Go to any online midi player with USB capabilities, like
. Make sure the Gopher Badge MIDI is enabled (this website works better in Chrome, other browsers might not detect the Gopher Badge as a MIDI device).
Press the buttons and create your melody.&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="step6"
srcset="https://goeducation.net/docs/gopherbadge/tutorial/step8_hu_e0e4529712ab8771.webp 320w, https://goeducation.net/docs/gopherbadge/tutorial/step8_hu_17ad6aacad14f9ec.webp 480w, https://goeducation.net/docs/gopherbadge/tutorial/step8_hu_4f33a0387b45f6cd.webp 760w"
sizes="(max-width: 480px) 100vw, (max-width: 768px) 90vw, (max-width: 1024px) 80vw, 760px"
src="https://goeducation.net/docs/gopherbadge/tutorial/step8_hu_e0e4529712ab8771.webp"
width="760"
height="394"
loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 id="step9go---buttons-accelerometer-usb-hid-interface"&gt;step9.go - Buttons, Accelerometer, USB HID interface&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 gopher-badge ./tutorial/basics/step9
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Your Gopher Badge, connected to a computer, will act as a mouse now. Pressing the A button will perform a left click, B button a right click, and inclining the badge will move the mouse&amp;rsquo;s pointer thanks to the badge&amp;rsquo;s built-in accelerometer.&lt;/p&gt;
&lt;p&gt;Good job in completing the basic tutorials. Now can check out the more advanced 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;
&lt;h2 id="next-steps--ideas"&gt;Next steps &amp;amp; ideas&lt;/h2&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Add new effects and animations to the badge code, like Multipass from &lt;em&gt;The fifth element&lt;/em&gt; movie.&lt;/li&gt;
&lt;li&gt;Use the 3-axis accelerometer to check if the wearer has tripped and fall down and send an SOS alarm (SOS in morse code is &amp;hellip; &amp;mdash; &amp;hellip; , use the buzzer and RGB LEDs)&lt;/li&gt;
&lt;li&gt;Create your own Rubber Duck attack (examples/rubber-duck).&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id="not-powering-up-with-battery-connected"&gt;Not powering up with battery connected&lt;/h1&gt;
&lt;p&gt;If your battery is connected and switching your badge to ON doesn&amp;rsquo;t power it up, &lt;strong&gt;disconnect your battery, switch to ON and connect your battery again&lt;/strong&gt;. If it doesn&amp;rsquo;t power up, then check the battery charge.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Official repository:
&lt;/p&gt;</description></item></channel></rss>