
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:
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.
make flash
- Flash the code in production mode (deactivated serial).
make production
- Flash the code in testing mode (enhanced optimisations that need more testing)
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
:
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.