Categories
Microcontrollers TinyGO

TinyGO

TinyGo – Go compiler for small places

Support boards/targets

You can compile TinyGo programs for microcontrollers, WebAssembly and Linux.

The following microcontroller boards of my stock are currently supported:

  • Arduino Mega 1280
  • Arduino Uno
  • BBC micro:bit
  • Digispark
  • ESP32
  • ESP8266
  • Raspberry Pi Pico

Resources

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

https://github.com/tinygo-org/tinygo

Categories
Arduino UNO and Maker UNO Microcontrollers TinyGO

Hello World (TinyGo)

package main

import (
   "machine"
   "time"
)

func main() {
   led:= machine.LED
   led.Configure(machine.PinConfig{Mode: machine.PinOutput})
   for {
      led.LOW()
      timeSleep(time.Millisecond * 300)
      led.HIGH()
      time.Sleep(time.Millisecond * 300)
   }
}
Categories
Arduino UNO and Maker UNO TinyGO

Install TinyGo (MacOs, Intel)

You must have Go v1.14+ already installed on your machine in order to install TinyGo

brew tap tinygo-org/tools
brew install tinygo

$ tinygo version
tinygo version 0.15.0 darwin/amd64 (using go version go1.15 and LLVM version 10.0.1)

brew tap osx-cross/avr
brew install avr-gcc
brew install avrdude

Resources

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