https://github.com/clach04/pebble_watchface_framework
Working, ready to build Bare-Bones watch face for Pebble (OG/Classic, Time, Round, and Pebble 2) Aplite, Basalt, Chalk, and Diorite. With configuration and settings support via Clay.
Requires Pebble SDK of some kind (current code and WAF script is for SDK 4.5). Original instructions are for CloudPebble.
Current code works with local SDK, recommend using a Docker Container, for example:
GitHub Actions note, https://github.com/clach04/pebble_watchface_framework/blob/master/.github/workflows/main.yml includes a pebble build action that runs by default on every push to master! NOTE Downloads are ONLY available when logged into Github, otherwise, the Artifacts "PebblePBW" text is not a link (without any hint as to what is going on). Kudos to https://github.com/daktak for initial version that the action used here is based on. First seen in https://github.com/mattrossman/forecaswatch2/pull/50
Installation notes for PBW (Android specific, assuming Pebble/Rebble App is installed https://help.rebble.io/setup/):
All the examples below use the same framework.
Then start adding options and resources. By default the empty framework will:
In an ideal situation, watchface.c
and watchface.h
should not need editing ever. There may be cases where main.c
needs editing. Most of the time watch_config.h
is the only file that will need editing. watch_config.h
options:
DEFAULT_TIME_COLOR
is defined it will be used for the default time color.DEFAULT_BACKGROUND_COLOR
is defined it will be used for the default background time color.BG_IMAGE
, it will be used as a background image. For Basalt, image transparency is honored.FONT_NAME
, it will be used for displaying the time. E.g. #define FONT_NAME RESOURCE_ID_.....
FONT_SYSTEM_NAME
is defined to a system font name and FONT_NAME
is not defined, that system font will be used for time displayREMOVE_LEADING_ZERO_FROM_TIME
is defined, and the watch is configured for 12 hour format display, the leading zero "0" will be removed for times in the morning.CLOCK_POS
, BT_POS, DATE_POS
, and BAT_POS
to change the on screen position of Time, Bluetooth disconnect message, Date, and battery power.FONT_BT_SYSTEM_NAME
, FONT_BAT_SYSTEM_NAME
, and FONT_DATE_SYSTEM_NAME
can override the system font used.
USE_TIME_FONT_FOR_DATE
is defined, the date is displayed using the same font as used for timeBT_ALIGN
, BAT_ALIGN
, and TIME_ALIGN
are used to change text alignment.BLUETOOTH_DISCONNECTED_STR
is defined, this text will be displayed for the Bluetooth disconnect message.BT_DISCONNECT_IMAGE
is defined, this resource image will be displayed on bluetooth disconnect.
BT_DISCONNECT_IMAGE_GRECT
can be used to position the imageDATE_FMT_STR
is defined it will be used for the format of the date text.BAT_FMT_STR
is defined it will be used for the format of the battery power text.
DRAW_SMALL_BATTERY
is defined a small gauge will be used.DRAW_BATTERY
is defined a graphical gauge will be used instead of textQUIET_TIME_IMAGE
is defined as a bitmap resource identifier it will be displayed when quiet time is active.
QUIET_TIME_IMAGE_GRECT
to location/sizeNO_BLUETOOTH
, NO_BATTERY
, and NO_DATE
will disable display of bluetooth disconnect, battery status, and date.USE_HEALTH
is defined step counts will be displayed. Pebble Time and later only.
UPDATE_HEALTH_ON_ACTIVITY
is set, step count is updated when the Pebble Health service has an update. If not set, step count is updated once per minute.HEALTH_POS
is a GRect()HEALTH_FMT_STR
is the format of the string to display. MAX_HEALTH_STR
should be updated if HEALTH_FMT_STR
is set.USE_TIME_MACHINE
is defined https://github.com/MorrisTimm/pebble-time-machine will be used ('dependencies' in package.json should be filled in, known to work with version 1.0.2).Edit watch_config.h
at the bottom, add the following lines:
#define TICK_HANDLER_INTERVAL SECOND_UNIT // Update once per second
#define TIME_FMT_STR_24H "%R:%S" // Display seconds
#define TIME_FMT_STR_12H "%I:%M:%S" // Display seconds, produces leading zero for hour,minute, and seconds
#define MAX_TIME_STR "00:00:00" // Ensure space allocated for string representation of time
#define FONT_SYSTEM_NAME FONT_KEY_ROBOTO_CONDENSED_21 // Use a medium sized system font
This will show seconds (the %S
in both formats) and update once a second (by setting TICK_HANDLER_INTERVAL
to update once a second). MAX_TIME_STR
is updated to ensure space is allocated for both the colon and the two digits.
FONT_50
- 50 means scale to 50 (optional enter in the CHARACTERS field [0-9:.]
to only use the characters needed for time, makes watchface smaller), Click Save.watch_config.h
add line #define FONT_NAME RESOURCE_ID_FONT_50
add after (or replace) '#undef FONT_NAME' to match resource name above#define DEBUG_TIME
to try wide fonts. For example using the permanent-marker font above with size 60 looks fine for some times but not all. DEBUG_TIME quickly tries a number of different times to check sizes. Also see USE_TIME_MACHINE
notes.NOTE there are limitations in the Pebble SDK/Firmware on maximum font size. 60 is the absolute maximum, and for some fonts even 60 is problematic. Very large fonts need to be converted into bitmaps, see https://github.com/pebble-examples/big-time
For suggestions on image options and conversion see https://www.reddit.com/r/pebble/comments/3ej5wf/pebble_time_image_conversion_contrast/
Multi-platform support https://developer.rebble.io/developer.pebble.com/guides/best-practices/index.html
SDK API https://developer.rebble.io/developer.pebble.com/docs/index.html
Pebble developer wiki https://github.com/pebble-dev/wiki/wiki