Coder Social home page Coder Social logo

gopherbot's Introduction

Gopherbot

Gopherbot is a robot gopher plushie that is programmable using TinyGo (https://tinygo.org)

GoDoc

Uses an Adafruit Circuit Playground Express with a 3D printed helmet and backpack.

Here is a TinyGo program that blinks all of the various built-in LEDs all at the same time when the slider switch is in the "on" position.

package main

import (
	"time"

	"github.com/hybridgroup/gopherbot"
)

func main() {
	led := gopherbot.StatusLED()
	antenna := gopherbot.Antenna()
	visor := gopherbot.Visor()
	backpack := gopherbot.Backpack()

	slider := gopherbot.Slider()

	for {
		if slider.IsOn() {
			led.On()
			antenna.On()
			visor.Blue()
			backpack.Blue()
			time.Sleep(500 * time.Millisecond)

			led.Off()
			antenna.Off()
			visor.Off()
			backpack.Off()
			time.Sleep(500 * time.Millisecond)
		}
	}
}

Assembling Your Kit

Did you receive a Gopherbot kit? Awesome! For assembly instructions, go here:

Gopherbot Assembly Instructions

The 3D designs for the helmet, ears, and backpack are created by Damen Evans under the Creative Commons - Attribution - Non-Commercial license. The files are located here:

https://www.thingiverse.com/thing:3761937

Installation

To put code on Gopherbot, you need to install some software on your own machine.

Go 1.13

If you have not installed Go 1.13 on your computer already, you can download it here:

https://golang.org/dl/

TinyGo

Follow the instructions here to install TinyGo:

https://tinygo.org/getting-started/

TinyGo drivers

To install the various drivers and other code dependencies run this command:

go get -u tinygo.org/x/drivers

Gopherbot code

Lastly, get the code from this repository:

git clone https://github.com/hybridgroup/gopherbot.git
cd gopherbot

OK great, we're ready to write our first TinyGo program and put it on Gopherbot.

Hello, Gopherbot

Gopherbot uses an Adafruit Circuit Playground Express as its "brain". To put new code on the Circuit Playground Express you can copy a file in the correct format from your computer to the board using a USB connection without having to install any extra flashing software. This is because it comes with a "bootloader" named UF2 already installed, that lets to do the flashing. Here is more information about the UF2 bootloader if you are interested.

Here is what to do:

  • Plug your Circuit Playground Express into your computer's USB port.
  • Build and flash your TinyGo program to the board in .uf2 format using this command:
tinygo flash -target=circuitplay-express examples/blinky1
  • The Circuit Playground Express board should restart and then begin running your program. This program just causes the small LED labelled "D13" on the Circuit Playground Express board to start blinking on and off.

Now you are ready to try something a little more flashy.

  • Build and flash the demo TinyGo program to the board using this command:
tinygo flash -target=circuitplay-express ./examples/blink/main.go

Now THAT is a blink!

What To Do Next?

If you want to load one of the example programs on Gopherbot, check out our examples located here.

For a series of activities to learn programming TinyGo using Gopherbot, check out the learn folder.

Have fun!

gopherbot's People

Contributors

deadprogram avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.