TinyGo attitude estimation simulation applet. Here's a youtube video of the app in action with a Raspberry Pi Pico.
- Go installed (golang.org)
- git installed (git-scm.com)
- TinyGo installed (tinygo.org)
- gopherjs installed: once Go installed, run
go install github.com/gopherjs/gopherjs@latest
in console
-
Clone repository to local computer
git clone https://github.com/soypat/tiny-ahrsim.git
-
Change directory to this repo and generate frontend app with gopherjs
gopherjs build ./graphics/
This should create two files:
graphics.js
andgraphics.js.map
. -
Run the tinygo program (under
tinygo
directory) on your microcontroller of choice, make sure your microcontroller is accesible via USB. Take note of the port which it is available on (usually COM1, COM2, or COM3 on windows). For an Arduino UNO you'd flash the program as follows:tinygo flash -target=arduino ./tinygo/main.go
-
Run Simulation program specifying the port of the USB device
go run . -ttl=COM3 -p=":8080"
-
Open
index.html
with a browser and you are set.
The gopherjs bindings for three.js
have been archived!
If you are starting a new project consider using the WASM bindings!