2021-10-04 16:51:48 +00:00
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* BINARY WATCH
* for Bangle 1 / 2
* inspired by RAL tec binary wrist watch
*
* TODO :
* - vibrate on full hour
* -
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/* reuqirements */
2021-11-18 20:54:27 +00:00
require ( "Font7x11Numeric7Seg" ) . add ( Graphics ) ;
require ( "Font5x7Numeric7Seg" ) . add ( Graphics ) ;
2021-10-04 16:51:48 +00:00
/* constants and definitions */
2021-10-07 08:42:25 +00:00
/* Bangle 2: 176 x 176 */
2021-10-07 08:05:18 +00:00
2021-11-18 20:54:27 +00:00
/* month images */
var month = [
/* JAN */ { width : 53 , height : 24 , bpp : 1 , buffer : require ( "heatshrink" ) . decompress ( atob ( "AAMf/0D8AFBkM/9EvwMAgcM/3B30YgE4uEOh354EB4eAuFz90Ah0cgeDx9wgFw8Ecjk7wEDw8A8AIBgEcnEHg4IBgFh4EYnEDHYMF/8AwBID/BODgN/4EgAoI0BgODwExGgkDzg0FAII0D88A8PAnAIBAIMOgPBBAPAiBpCgPAQIOAmFwg0P/B5BwcAiE/JYYAHA" ) ) } ,
/* FEB */ { width : 51 , height : 24 , bpp : 1 , buffer : require ( "heatshrink" ) . decompress ( atob ( "v/8n/+g/+if/hP/wM/8c/4Of8Ez/FwgE4gEHgFOAYUA8Ed4ADBgEcge4AYMAgeAu4DCgFwhwQBEIMOgPcAYMAgPAjN/4G/8EX/kf/EP/kB/+F/8C/+Ar/xGQkBGTE7wADBMIMHMotMgEGv+A7/hEYOf/EH/hvBh6FBIIKYFA" ) ) } ,
/* MAR */ { width : 52 , height : 23 , bpp : 1 , buffer : require ( "heatshrink" ) . decompress ( atob ( "v/4j/+gf/hP/gV/6FP/HP8kz/cGv8OgHDwFwuEE8McnEHg8A905BgcO8ecBiM4BgMwuEGoeEi/8gX/wE4gH/4Ef/AMFx0QDIcA8BADnEOgIzCufABgk+Bglx+AMEh+OBgdwvnghk4gcGgfsgFDgEQoEeSgvg" ) ) } ,
/* APR */ { width : 52 , height : 23 , bpp : 1 , buffer : require ( "heatshrink" ) . decompress ( atob ( "v/4j/4gf/hP/oV/4FP/HP9kz/EGv8OgPDwEguEE8EcnEHg8A9wMCuFwhwMTgAMBmFwg1f+EX/kC/+D/8A//AJIIMFxwZCgFwgAmCgEHnBNDgFz4AMEnwMEuPwBgkPxwMDuF88EMBgMGgfsgFDRgNAjyUF8A=" ) ) } ,
/* MAY */ { width : 52 , height : 24 , bpp : 1 , buffer : require ( "heatshrink" ) . decompress ( atob ( "v/4j/+AoMJ/8Cv/QAwPP8kz/cEgEugHDwFwsEG8McnEHg8A905BgVwh3jzgMRnAMBmAMBoeEi/8BgNgnEA//Ah/4BgcB/+OiAZCBgPgIARTB90BGYUAhwMahk4gYMBpkAocAiEP+CSDIAOAAwYMB" ) ) } ,
/* JUN */ { width : 53 , height : 24 , bpp : 1 , buffer : require ( "heatshrink" ) . decompress ( atob ( "AAcD8ADBkMAhEvwIJBhkA4O+jEAnFwh0O/PAgPDwFwufugEOjkDwePuEAuHgjkcneAgeHgHgBAMAjk4g8HBAMAsPAjE4gY7BggCBwBPLkACBGgMBweAmI0EgecGgoBBGgfngHh4E4BAIBBh0B4IIB4EQmEEBAPA/0An5qBg0P/ED/xNBiAKBh6PCAAw=" ) ) } ,
/* JUL */ { width : 53 , height : 24 , bpp : 1 , buffer : require ( "heatshrink" ) . decompress ( atob ( "AA8hgEImAFBgcMgHB4AGBnFwh0OAoMB4eAuFwAwMOjkDweAAwNw8EcjggCw8A8HgAwMcnEHg40CsPAjE4AwUEAQIgCABMgGgcBGgMBGgo/BGggKBGgYBB8PAnA0BBQMOgJpC4EQmEENIX+gE/wFn/EP/ED/0Cv/gBQMP8EP/5QGA" ) ) } ,
/* AUG */ { width : 52 , height : 24 , bpp : 1 , buffer : require ( "heatshrink" ) . decompress ( atob ( "n/8AocE/+gAgMP/1n+0QgGA//HgHhwEYl/wuEOjkDw8Ag4MB4E4uEABilhBgcv/EcgOCgEB/+AwBBB/AMBAgMCj/ngFgAwNw/wmCgImBBgIzDhwzFBikGhkBgUAs0AkEf4EH+A3Bgf+gBLBAwIMD" ) ) } ,
/* SEP */ { width : 51 , height : 23 , bpp : 1 , buffer : require ( "heatshrink" ) . decompress ( atob ( "h/4j//g/+gf/wn/4M/8ABB5/wmf4mEAjkAg8Ap0AgeAgHgjvAgFwBwMD3EAhwOCu8AgIOCh3ggE4BwMB7gjCBwMYv/Ar/wi/8j/8IYMB/+BIYIODDwIyCLIMHGQYGB8JBDB4IyCAoMDw5BDB4JBDgEEMoZ6Cn/A8A6B8FP/kYgEf/EH/4eCA" ) ) } ,
/* OCT */ { width : 50 , height : 23 , bpp : 1 , buffer : require ( "heatshrink" ) . decompress ( atob ( "h/gg/+j//w/8gf/h//+H+gF/wP//OAkHADAXgjlwAoU4g8cAgMYh0B44pCgeAuIYBgfADAnwnEDDAUcghCDgRMIsACBkAYFGKZKDngYFgJjBwAYCPgX4DAMHPgQYBgB8C8EGgAA=" ) ) } ,
/* NOV */ { width : 51 , height : 24 , bpp : 1 , buffer : require ( "heatshrink" ) . decompress ( atob ( "vkAgf4AoMX4GA/+ABIN8mEP8EggP350MgMGgF+vvDwFw8Ef4+4uEOjgiBu8OgIOBv8A8PAnFwEQMcnEHBwP8gOHgFh4EdHYNAgEQgJLFggFEhPAjFwg0cg4jDGQPnGQk8GQkPI4IyB8PDKwYOB+BWBMoMHnkOgHAn+A98BwEIh/4jnAHgX+gaGBAAcggAA==" ) ) } ,
/* DEC */ { width : 49 , height : 23 , bpp : 1 , buffer : require ( "heatshrink" ) . decompress ( atob ( "v/gj//gP/5/4iYFC2f4hn/CAOcgMHgEBwEOgPDwEB4AJB8PAgHggeAuHggFwBoM4uEAnANBjgDBjgNBgwDBh0AiEAgowBAAQ6BwEAggFBv/BwAwBsIwWhwwDnEHAYIiBjhhDgEN/0Dn/Aj/hO4M/+Ef/JABv/8g/+A==" ) ) } ,
/* MAI */ { width : 44 , height : 23 , bpp : 1 , buffer : require ( "heatshrink" ) . decompress ( atob ( "v/4j/+gEJ/8Cv/QgnP8kz/cA50A4eAuEc8McnEHgPOnIKD8ecBR04BQMwhlDwkX/kAoE4gH/4EABQlOiAVD8A2EgIrDBS0MnEDgHMGQMAiEEPwo=" ) ) } ,
/* OKT */ { width : 51 , height : 24 , bpp : 1 , buffer : require ( "heatshrink" ) . decompress ( atob ( "g/wAQMP//B/8DgPh//8j/AuF8n//jECh0fDAUA8PH4AGB8EcnIhBsEcgeHvkAj0DwFw98AgYjBh0dDAN4h0A4eAEgQDBl/4gFAE4MD/5OE3/ggIyBhk4gcAuAyCBIIyDIIIyDAgOAGQMBGQNwh8B4E4BwMB8BlCBIM8gF/AgMYg+Aj/wmA3B+EB/hBChiYGA" ) ) } ,
/* DEZ */ { width : 51 , height : 23 , bpp : 1 , buffer : require ( "heatshrink" ) . decompress ( atob ( "n/wh//w//xP/gV/8F//Of4Fn/EH/04gUODAUHgHh4AFBnHgjk4BYUcgeHAoMB8eAuHgAwN4uEOjgFBh4jB4eAgED4ADBl/4gFwB4MD/4DBgQCB3/gC4PghgyBgPAGQl4gYyDjwgBGQQrBh0BGQVwDQM4F4MMLIJlEg3/gOfPAPgn/gk/+j/+h/8IoPh//gA=" ) ) }
] ;
var imgSquid = { width : 88 , height : 26 , bpp : 1 , buffer : require ( "heatshrink" ) . decompress ( atob ( "gE/AYUYgEH////0B//gBQM8BQgDB/AKHh/A/gKBvwKBAgMOj8AnwKHBAIMBgH/BQgmCAoPnBQl4AoOAgPnwAKDuEAgYKB4YKIgfD4AKDMAMB4EDwIKIg+B8AKIgAKIh8A+AKHh0AuAKHj0AvBMG4EcgE4K458Bnh4HnEAjiOHBwMeBQpKBEgMOXQ/wBwIKDaAZQBg4KDcwT0BAAOHfgoKHgE/wDaBAAL8DA=" ) ) } ;
2021-11-18 21:03:02 +00:00
var imgNoBT = { width : 20 , height : 20 , bpp : 3 , transparent : 0 , buffer : require ( "heatshrink" ) . decompress ( atob ( "///8mSpM/AoP/yUT/8yuYGB5AMB/1MyYUBkmT/P85MP+USBwOT8mQ/8JBwXyoVnyGSv8//Mhk14pMn//8BYNMwmSp/+pFJkgyBDoMkkgODpOSuQOE5M/KgIOCsmfz/JknPhMyof5n+Ss/wzMhn4OBk1+smQLoWTn/mHAM/+VJz4KBwhZBEYJ/CkM8yZVBAAQxBCgP/A=" ) ) } ;
2021-10-07 08:05:18 +00:00
const V2 _X _STEP = 26 ;
const V2 _Y _STEP = 34 ;
2021-11-18 20:54:27 +00:00
const V2 _TIME _Y _OFFSET = 8 ;
const V2 _HX = 36 ;
2021-10-07 08:05:18 +00:00
const V2 _HY = 0 + V2 _TIME _Y _OFFSET ;
const V2 _MX = 10 ;
2021-11-18 20:54:27 +00:00
const V2 _MY = 51 + V2 _TIME _Y _OFFSET ;
2021-10-07 08:05:18 +00:00
const V2 _SX = 10 ;
2021-11-18 20:54:27 +00:00
const V2 _SY = 95 + V2 _TIME _Y _OFFSET ;
2021-11-18 21:03:02 +00:00
const V2 _BT _X = 137 ; /* 145, 35 */
2021-11-18 20:54:27 +00:00
const V2 _BT _Y = 20 ;
const V2 _DX = 100 ;
const V2 _DY = 141 ;
const V2 _BAT _POS _X = 21 ;
const V2 _BAT _POS _Y = 40 ;
const V2 _BAT _SIZE _X = 13 ;
const V2 _BAT _SIZE _Y = 2 ;
2021-10-07 08:05:18 +00:00
const V2 _SCREEN _SIZE _X = 176 ;
const V2 _SCREEN _SIZE _Y = 176 ;
2021-11-23 16:59:49 +00:00
const V2 _BACKGROUND _IMAGE = "binwatch.bg176.img" ;
2024-03-04 20:34:50 +00:00
//const V2_BG_COLOR = 0;
//const V2_FG_COLOR = 1;
2021-10-07 08:05:18 +00:00
2021-10-04 16:51:48 +00:00
/* Bangle 1: 240 x 240 */
2021-10-07 08:05:18 +00:00
const V1 _X _STEP = 35 ;
const V1 _Y _STEP = 46 ;
2021-10-04 16:51:48 +00:00
2021-10-07 08:05:18 +00:00
const V1 _TIME _Y _OFFSET = 41 ;
const V1 _HX = 48 ;
const V1 _HY = 0 + V1 _TIME _Y _OFFSET ;
const V1 _MX = 14 ;
const V1 _MY = 55 + V1 _TIME _Y _OFFSET ;
const V1 _SX = 14 ;
const V1 _SY = 110 + V1 _TIME _Y _OFFSET ;
const V1 _BT _X = 41 ;
const V1 _BT _Y = 14 ;
2021-10-04 16:51:48 +00:00
//var BT_X = 20, BT_Y = 14;
2021-10-07 08:05:18 +00:00
const V1 _DX = 160 ;
const V1 _DY = 205 ;
2021-10-04 16:51:48 +00:00
2021-10-07 08:05:18 +00:00
const V1 _BAT _POS _X = 175 ;
const V1 _BAT _POS _Y = 21 ;
const V1 _BAT _SIZE _X = 3 ;
const V1 _BAT _SIZE _Y = 5 ;
const V1 _SCREEN _SIZE _X = 240 ;
const V1 _SCREEN _SIZE _Y = 240 ;
2021-11-23 16:59:49 +00:00
const V1 _BACKGROUND _IMAGE = "binwatch.bg240.img" ;
2024-03-04 20:34:50 +00:00
//const V1_BG_COLOR = 1;
//const V1_FG_COLOR = 0;
2021-10-07 08:42:25 +00:00
2021-10-07 08:05:18 +00:00
/* runtime settings */
2021-10-07 08:42:25 +00:00
2021-10-07 08:05:18 +00:00
var x _step = 0 ;
var y _step = 0 ;
2024-03-04 20:34:50 +00:00
//var time_y_offset = 0;
2021-10-07 08:05:18 +00:00
var hx = 0 , hy = 0 ;
var mx = 0 , my = 0 ;
var sx = 0 , sy = 0 ;
var bt _x = 0 , bt _y = 0 ;
var dx = 0 , dy = 0 ;
var bat _pos _x , bat _pos _y , bat _size _x , bat _size _y ;
var backgroundImage = "" ;
var screen _size _x = 0 ;
var screen _size _y = 0 ;
2024-03-04 20:34:50 +00:00
//var bg_color = 0;
//var fg_color = 1;
2021-10-04 16:51:48 +00:00
var showDateTime = 2 ; /* show noting, time or date */
2021-10-07 08:05:18 +00:00
var cg ;
var cgimg ;
2021-10-04 16:51:48 +00:00
/* local functions */
/ * *
* function drawSquare ( ... )
*
* go through all bits and draw a square if a bit
* is set . So we get the binary representation
* of the value
* used to draw block for hours , mintutes , seconds , date
*
* @ param gfx : graphic object to use
* @ param x : x - coordinate of 1 st the square
* @ param y : y - coordinate of 1 st the square
* @ param data : data conatining the bit information
* @ param numOfBits : number of bits to draw
* /
function drawSquare ( gfx , x , y , data , numOfBits ) {
2021-11-18 20:54:27 +00:00
2024-03-13 10:51:40 +00:00
for ( let i = numOfBits ; i > 0 ; i -- ) {
2021-10-04 16:51:48 +00:00
if ( ( data & 1 ) != 0 ) {
gfx . fillRect ( x + ( i - 1 ) * x _step , y ,
x + i * x _step , y + y _step ) ;
}
data >>= 1 ; /* shift one bit right */
}
}
/ * *
* function drawBinary ( ... )
* draw the time in binary format
* default display for geeks and real men
* @ param h : hours
* @ param m : minutes
* @ param s : seconds
* /
function drawBinary ( gfx , hour , minute , second ) {
2021-11-18 20:54:27 +00:00
gfx . clear ( 0 ) ;
2021-10-04 16:51:48 +00:00
if ( hour > 12 ) {
hour -= 12 ; /* we use for bit for hours so we only display 12 hours*/
}
2021-10-07 08:05:18 +00:00
drawSquare ( gfx , hx , hy , hour , 4 ) ; /* set hour */
drawSquare ( gfx , mx , my , minute , 6 ) ; /* set minute */
drawSquare ( gfx , sx , sy , second , 6 ) ; /* set second */
2021-10-04 16:51:48 +00:00
}
/ * *
* function drawTime ( ... )
* show time under the graphic
* for wimps and commies
*
* @ param h : hours
* @ param m : minutes
* @ param s : seconds
* /
function drawTime ( gfx , h , m , s ) {
var time = ( " " + h ) . substr ( - 2 ) + ":" + ( "0" + m ) . substr ( - 2 ) + ":" + ( "0" + s ) . substr ( - 2 ) ;
gfx . setFontAlign ( 0 , - 1 ) ; // align right bottom
2021-11-18 20:54:27 +00:00
gfx . setFont ( "7x11Numeric7Seg" , 2 ) ;
gfx . drawString ( time , gfx . getWidth ( ) / 2 , dy + 1 , false /*clear background*/ ) ;
2021-10-04 16:51:48 +00:00
}
/ * *
* function drawDate ( ... )
* show date under the graphic
* ( optionally )
*
* @ param gfx : graphic object to use
* @ param d : date object
* /
2021-11-18 20:54:27 +00:00
var vMonth = 0 ;
2021-10-04 16:51:48 +00:00
function drawDate ( gfx , d ) {
var dateString = ""
2021-11-18 20:54:27 +00:00
+ ( "0" + d . getDate ( ) ) . substr ( - 2 )
// + " "
// + ("0" + d.getMonth()).substr(-2)
// + " "
// + ("0" + d.getFullYear()).substr(-2)
;
gfx . setFontAlign ( - 1 , - 1 ) ; // align right bottom
gfx . setFont ( "7x11Numeric7Seg" , 2 ) ; /* draw the current time font */
gfx . drawString ( dateString , dx , dy + 1 , false /* don't clear background*/ ) ;
gfx . drawImage ( month [ d . getMonth ( ) ] , 40 , dy ) ;
2021-10-04 16:51:48 +00:00
}
function toggleDateTime ( ) {
showDateTime ++ ;
if ( showDateTime > 2 ) {
showDateTime = 0 ;
}
}
function updateVTime ( ) {
2021-11-18 20:54:27 +00:00
vMonth ++ ;
if ( vMonth >= 12 + 3 ) {
vMonth = 0 ;
}
2021-10-04 16:51:48 +00:00
second ++ ;
if ( second > 59 ) {
second = 0 ;
minute ++ ;
if ( minute > 59 ) {
minute = 0 ;
hour ++ ;
if ( hour > 12 ) {
hour = 0 ;
}
}
}
}
/ * *
* function drawBattery ( ... )
* fill the battery symbol with blocks
* according to the battery level
*
* @ param gfx : graphic object
* @ param level : current battery level
* /
function drawBattery ( gfx , level ) {
2021-11-18 20:54:27 +00:00
var pos _y = bat _pos _y - 1 ;
2021-10-04 16:51:48 +00:00
var stepLevel = Math . round ( ( level + 10 ) / 20 ) ;
2021-10-07 09:06:23 +00:00
2024-03-13 10:51:40 +00:00
for ( let i = 0 ; i < stepLevel ; i ++ ) {
2021-11-18 20:54:27 +00:00
pos _y -= bat _size _y + 2 ;
gfx . fillRect ( bat _pos _x , pos _y ,
bat _pos _x + bat _size _x , pos _y + bat _size _y ) ;
2021-10-04 16:51:48 +00:00
}
}
/ * *
* function drawBattery ( ... )
* fill the battery symbol with blocks
* according to the battery level
*
* @ param gfx : graphic object
* @ param level : current battery level
* /
2021-11-18 20:54:27 +00:00
function drawBT ( gfx , status ) {
if ( ! status ) {
2021-11-18 21:03:02 +00:00
gfx . drawImage ( imgNoBT , bt _x , bt _y ) ;
2021-11-18 20:54:27 +00:00
}
2021-10-07 08:05:18 +00:00
}
function setRuntimeValues ( resolution ) {
if ( 240 == resolution ) {
x _step = V1 _X _STEP ;
y _step = V1 _Y _STEP ;
2024-03-04 20:34:50 +00:00
//time_y_offset = V1_TIME_Y_OFFSET;
2021-10-07 08:05:18 +00:00
hx = V1 _HX ;
hy = V1 _HY ;
mx = V1 _MX ;
my = V1 _MY ;
sx = V1 _SX ;
sy = V1 _SY ;
bt _x = V1 _BT _X ;
bt _y = V1 _BT _Y ;
dx = V1 _DX ;
dy = V1 _DY ;
screen _size _x = V1 _SCREEN _SIZE _X ;
screen _size _y = V1 _SCREEN _SIZE _Y ;
2021-11-23 15:51:40 +00:00
backgroundImage = V1 _BACKGROUND _IMAGE ;
2021-11-18 20:54:27 +00:00
2021-10-07 09:06:23 +00:00
bat _pos _x = V1 _BAT _POS _X ;
bat _pos _y = V1 _BAT _POS _Y ;
bat _size _x = V1 _BAT _SIZE _X ;
bat _size _y = V1 _BAT _SIZE _Y ;
2021-11-18 20:54:27 +00:00
2021-11-23 15:51:40 +00:00
setWatch ( toggleDateTime , BTN1 , { repeat : true , edge : "falling" } ) ;
2021-11-18 20:54:27 +00:00
2021-10-07 08:05:18 +00:00
} else {
x _step = V2 _X _STEP ;
y _step = V2 _Y _STEP ;
2024-03-04 20:34:50 +00:00
//time_y_offset = V2_TIME_Y_OFFSET;
2021-10-07 08:05:18 +00:00
hx = V2 _HX ;
hy = V2 _HY ;
mx = V2 _MX ;
my = V2 _MY ;
sx = V2 _SX ;
sy = V2 _SY ;
bt _x = V2 _BT _X ;
bt _y = V2 _BT _Y ;
dx = V2 _DX ;
dy = V2 _DY ;
screen _size _x = V2 _SCREEN _SIZE _X ;
screen _size _y = V2 _SCREEN _SIZE _Y ;
backgroundImage = V2 _BACKGROUND _IMAGE ;
2021-10-07 09:06:23 +00:00
bat _pos _x = V2 _BAT _POS _X ;
bat _pos _y = V2 _BAT _POS _Y ;
bat _size _x = V2 _BAT _SIZE _X ;
bat _size _y = V2 _BAT _SIZE _Y ;
2021-11-18 20:54:27 +00:00
Bangle . on ( 'swipe' , function ( direction ) { toggleDateTime ( direction ) ; } ) ;
2021-10-07 09:06:23 +00:00
}
2021-10-07 08:05:18 +00:00
cg = Graphics . createArrayBuffer (
screen _size _x , screen _size _y , 1 , { msb : true } ) ;
2021-11-18 20:54:27 +00:00
2021-10-07 08:05:18 +00:00
cgimg = { width : screen _size _x , height : screen _size _y , bpp : 1 ,
transparent : 0 , buffer : cg . buffer } ;
2021-10-04 16:51:48 +00:00
}
var hour = 0 , minute = 1 , second = 50 ;
2021-10-07 09:06:23 +00:00
var batVLevel = 20 ;
2021-10-07 08:05:18 +00:00
2022-09-06 16:38:13 +00:00
Bangle . setUI ( "clock" ) ;
2021-10-07 08:05:18 +00:00
2021-10-04 16:51:48 +00:00
function draw ( ) {
var d = new Date ( ) ;
var h = d . getHours ( ) , m = d . getMinutes ( ) , s = d . getSeconds ( ) ;
2021-11-18 20:54:27 +00:00
g . reset ( ) ;
2021-10-04 16:51:48 +00:00
drawBinary ( cg , h , m , s ) ;
2021-11-18 20:54:27 +00:00
2021-10-04 16:51:48 +00:00
switch ( showDateTime ) {
case 1 :
drawTime ( cg , h , m , s ) ;
break ;
case 2 :
drawDate ( cg , d ) ;
break ;
default :
2021-11-18 20:54:27 +00:00
cg . drawImage ( imgSquid , cg . getWidth ( ) / 2 - 44 , dy ) ;
2021-10-04 16:51:48 +00:00
}
2021-11-18 20:54:27 +00:00
drawBattery ( cg , /*batVLevel*/ E . getBattery ( ) ) ;
2021-10-04 16:51:48 +00:00
batVLevel += 2 ;
if ( batVLevel > 100 ) {
batVLevel = 0 ;
}
updateVTime ( ) ;
g . clear ( ) ;
g . drawImages ( [ { image : cgimg } ,
2021-11-23 16:34:13 +00:00
{ image : require ( "Storage" ) . read ( backgroundImage ) }
2021-10-04 16:51:48 +00:00
] ) ;
2021-11-18 20:54:27 +00:00
drawBT ( g , NRF . getSecurityStatus ( ) . connected ) ;
// Bangle.drawWidgets();
2021-10-07 08:05:18 +00:00
const millis = d . getMilliseconds ( ) ;
setTimeout ( draw , 1000 - millis ) ;
2021-11-18 20:54:27 +00:00
// Bangle.loadWidgets();
2021-10-04 16:51:48 +00:00
}
2021-10-07 08:05:18 +00:00
// Show launcher when button pressed
setRuntimeValues ( g . getWidth ( ) ) ;
g . reset ( ) . clear ( ) ;
Bangle . loadWidgets ( ) ;
Bangle . drawWidgets ( ) ;
draw ( ) ;