https://github.com/nerzal/tinygo-playground
This repo contains some examples showing tinygo features. Making use of arduino and webassembly
https://github.com/nerzal/tinygo-playground
arduino examples-go examples-html tinygo wasm-go webassembly
Last synced: 7 months ago
JSON representation
This repo contains some examples showing tinygo features. Making use of arduino and webassembly
- Host: GitHub
- URL: https://github.com/nerzal/tinygo-playground
- Owner: Nerzal
- License: apache-2.0
- Created: 2019-02-14T19:19:18.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-09-18T20:04:22.000Z (over 5 years ago)
- Last Synced: 2025-04-08T00:44:36.946Z (10 months ago)
- Topics: arduino, examples-go, examples-html, tinygo, wasm-go, webassembly
- Language: Go
- Homepage:
- Size: 1.15 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tinygo-playground
Examples do work with Arduino Uno
## starting vscode
> export GOOS=linux; export GOARCH=arm; export GOFLAGS=-tags=avr,baremetal,linux,arm,atmega328p,atmega,avr5,arduino,tinygo,gc.conservative,scheduler.none; code
## Flashing blink-sos
> tinygo flash --target=arduino cmd/blink-sos/sos.go
## Flashing traffic-light
> tinygo flash --target=arduino cmd/traffic-light/light.go
## Flashing traffic-button-light
> tinygo flash --target=arduino cmd/traffic-button-light/light.go
## hello-display
[turorial](https://www.arduino.cc/en/Tutorial/HelloWorld)
[image](https://www.arduino.cc/en/uploads/Tutorial/LCD_Base_bb_Fritz.png)
> tinygo flash --target=arduino cmd/hello-display/main.go
## Debugging
use println("text)
And when the arduino is running do
> cat /dev/ttyACM0
## Common Problems
> avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied
Change persmissions of the serial port by using the following command
> sudo chmod a+rw /dev/ttyACM0
## WASM
### Compile
> tinygo build -o ./wasm.wasm -target wasm ./main/main.go
### Make
> make main
### Start the Server
> go run server.go
### Compiled "main" example
