This is an attempt to build a toolkit for developing smartwatch firmware in Go (using TinyGo).
Supported smartwatches:
Supported features:
- Display.
- Battery charge indication. Not yet properly calibrated.
This repository contains some example firmwares that run on all devices that have all relevant features implemented:
examples/hello
draws a yellow rectangle and some text, for quick testing of the smartwatch.examples/battery
shows the current battery charge estimation and additionally also draws the voltage on the screen.examples/digitalclock
shows a very basic digital clock. It draws the current hour/minute on the screen. The time may be incorrect as TinyGo does not currently support setting the time on bare-metal systems.
You can flash one of the examples to a real smartwatch. For example, to run the digital clock example on a PineTime:
tinygo flash -target=pinetime-devkit0 github.com/aykevl/go-smartwatch/examples/digitalclock
Note: as of this time (2019-11-07), you will need the development version of TinyGo (the dev
branch). Take a look here for information on how to build it from source.
####using a stlink instead of a jlink
tinygo flash -target=pinetime-devkit0-stlink.json github.com/aykevl/go-smartwatch/examples/digitalclock
All features of this toolkit have been implemented for Linux as well, returning
something that at least looks legitimate. This allows for quick edit/test cycles
using go run
. For example:
go run github.com/aykevl/go-smartwatch/examples/digitalclock
This toolkit has been licensed under the BSD 2-clause license.