summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md25
-rw-r--r--watch-library/shared/watch/watch.h4
-rw-r--r--watch-library/simulator/main.c4
-rw-r--r--watch-library/simulator/watch/watch_main_loop.h2
4 files changed, 33 insertions, 2 deletions
diff --git a/README.md b/README.md
index e3afca06..90ce5119 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
The Sensor Watch
================
-The Sensor Watch is a board replacement for the classic Casio F-91W wristwatch. It is powered by a Microchip SAM L22 microcontroller with built-in segment LCD controller. You can write your own programs for the watch using the provided watch library, program the watch over USB using the built-in UF2 bootloader, and then install the board in your existing watch case to run your own software on your wrist.
+The [Sensor Watch](https://www.sensorwatch.net) is a board replacement for the classic Casio F-91W wristwatch. It is powered by a Microchip SAM L22 microcontroller with built-in segment LCD controller. You can write your own programs for the watch using the provided watch library, program the watch over USB using the built-in UF2 bootloader, and then install the board in your existing watch case to run your own software on your wrist.
![image](/images/sensor-watch.jpg)
@@ -47,8 +47,29 @@ Getting code on the watch
-------------------------
The watch library in this repository is very work-in-progress, but it should allow you to get started. To create a new project, copy the “starter-project” folder in the apps folder, and write your code in the app.c file.
-You will need to install [the GNU Arm Embedded Toolchain](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads/) to build projects for the watch. The watch library has been tested with the `9-2019-q4-major` version and the `10.3-2021.07` versions.
+You will need to install [the GNU Arm Embedded Toolchain](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads/) to build projects for the watch. The watch library has been tested with the `9-2019-q4-major` version and the `10.3-2021.07` versions. If you're using Debian or Ubuntu, it should be sufficient to `apt install gcc-arm-none-eabi`.
To build your project, open your terminal and navigate to the project's `make` folder, then type `make`.
To install the project onto your Sensor Watch board, plug the watch into your USB port and double tap the tiny Reset button on the back of the board. You should see the LED light up red and begin pulsing. (If it does not, make sure you didn’t plug the board in upside down). Once you see the “WATCHBOOT” drive appear on your desktop, type `make install`. This will convert your compiled program to a UF2 file, and copy it over to the watch.
+
+Using the Movement framework
+----------------------------
+If you just want to make minor modifications and use existing code, start with the `movement` directory. You can build the default watch firmware with:
+
+```
+cd movement/make
+make
+```
+
+Then copy `movement/make/build/watch.uf2` to your watch. If you'd like to modify which faces are built, see `movement_config.h`.
+
+You may want to test out changes in the emulator first. To do this, you'll need to install [emscripten](https://emscripten.org/), then run:
+
+```
+cd movement/make
+emmake make
+python3 -m http.server 8000 -d build
+```
+
+Finally, visit [watch.html](http://localhost:8000/watch.html) to see your work.
diff --git a/watch-library/shared/watch/watch.h b/watch-library/shared/watch/watch.h
index 7526d03a..790f9a16 100644
--- a/watch-library/shared/watch/watch.h
+++ b/watch-library/shared/watch/watch.h
@@ -30,6 +30,10 @@
#include "driver_init.h"
#include "pins.h"
+#ifdef __EMSCRIPTEN__
+#include "watch_main_loop.h"
+#endif // __EMSCRIPTEN__
+
/** @mainpage Sensor Watch Documentation
* @brief This documentation covers most of the functions you will use to interact with the Sensor Watch
hardware. It is divided into the following sections:
diff --git a/watch-library/simulator/main.c b/watch-library/simulator/main.c
index ac9db6ac..6898fd06 100644
--- a/watch-library/simulator/main.c
+++ b/watch-library/simulator/main.c
@@ -101,6 +101,10 @@ static void main_loop_set_sleeping(bool sleeping) {
}, sleeping);
}
+void delay_ms(const uint16_t ms) {
+ main_loop_sleep(ms);
+}
+
int main(void) {
app_init();
_watch_init();
diff --git a/watch-library/simulator/watch/watch_main_loop.h b/watch-library/simulator/watch/watch_main_loop.h
index 82351919..7599f727 100644
--- a/watch-library/simulator/watch/watch_main_loop.h
+++ b/watch-library/simulator/watch/watch_main_loop.h
@@ -31,3 +31,5 @@ void resume_main_loop(void);
void main_loop_sleep(uint32_t ms);
bool main_loop_is_sleeping(void);
+
+void delay_ms(const uint16_t ms);