Skip to content
A glittering, brightly colored logo

TinyGo Code

A Go Compiler For Small Places.

TinyGo is a custom Go compiler for embedded systems and WebAssembly. It was used to write the microcontroller code for recording the gyro data via Bluetooth.

Setup

Grab the project files:

Terminal window
git clone https://avoid.sh/PetActivityMonitor/pet_activity_recorder_tinygo.git

And follow the information in the README.md file of the project.

Usage

Only connect one microcontroller at the same time!

  • Flash the code to the connected microcontroller.
Terminal window
make flash
  • Flash the code in production mode (deactivated serial).
Terminal window
make production
  • Flash the code in testing mode (enhanced optimisations that need more testing)
Terminal window
make testing

To set the microcontroller into a flashable state manually the project also includes a flashing_time.py python script.

The script requires pyserial:

Terminal window
python -m pip install pyserial

When running the code with ./flashing_time or make prepare (inside of the project directory) the microcontroller will be put in a flashable state.

This state can also be activated manually by tapping the reset button on the microcontroller twice in a short time.