martes, 25 de octubre de 2022

(My) Best espruino apps (for bangle.js 1)


Clocks

Vertical watch face. 

Light weight, reliable, shows additional info, can  open launcher with a button or touch
[recommended]
 

Stardate Clock

 Nice, light weight, simple (digital/analog). Touch is not used.
[recommended]

Clock & Calendar

light weight and a great potential. 
Bad points(as v0.06):
launcher can't be accessed from bjs1 touch
the calendar view can't be open with  Bangle.js1 buttons or  Touch.
bottom widget area is not respected
 

Casio advanced

Powerful but too heavy weight for a bangle.js1 :(

Pastel clock 

Heavy weight, a simple watch face with configurable fonts and  able show additional info. Touch is not used.

Launchers

xx


miércoles, 5 de enero de 2022

Commands and developing for Espruino

 

 IDE commands

reset();  //most common command when you find problems

after any freeze

require("Storage").eraseAll();

Removes all files, including apps that can't be removed from apps loader 

E.setTimeZone(2);

peek16(0x300c).toString(16);   //TO see the espruino SDK

//0x8C or 0x91 is SDK12

//0x81 or 0x88 is SDK11


Memory usage per app

print(require("Storage").list().map(f=>require("Storage").read(f).length.toString().padStart(7)+" - "+f).sort());

It'll list all files sorted by size and you can see what's taking up the space


Status

process.env; 

process.memory();

require("Storage").getStats();

(total, free,...storage bytes)

E.getBattery() ;

print(require("Storage").list().map(f=>require("Storage").read(f).length.toString().padStart(7)+" - "+f).sort());


 Device name (useful for Gadgetbridge)

bangle.js , puck.js , espruino, espruino-dev 

NRF.setAdvertising({},{name:"espruino"});

 

Testing notifications

 GB({t:"notify", id:5, src:"gadget",title:"Test",body:"message for testing notifications "});

 


Basics of developing

 Logging:

console.log("Debug mode enabled");

Creating the icon

Compatibility and Dynamic code

Bangle.js1 =240x240

Bangle.js2= 176x176

var v_model=process.env.BOARD;
//EMSCRIPTEN,EMSCRIPTEN2
if (v_model=='BANGLEJS'||v_model=='EMSCRIPTEN') {

Multidevice developing (BJS1, BJS2, P8, C16....

Default background color/theme 
   BJS1 black bg
   BJS2 white bg
Display size
   BJS1 1.3 inch 240x240 
   BJS2 1.3 inch 176x176
Colors
   BJS1  16 bit LCD
   BJS2  3-bit color LCD
Button/touch screen
   BJS1  3 buttons+2 areas (simulated 3=1+2)
   BJS2  1 button+full touch screen


Code for bangle App Loader (store)

convert tab to spaces
trim trailing space

Spend time reading and understanding following help: