mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
11 lines
390 B
JavaScript
11 lines
390 B
JavaScript
(function() { // by @allObjects
|
|
return {
|
|
_v: false, // status on / off
|
|
read: function() { return this._v; },
|
|
set: function() { this.write(1); },
|
|
reset: function() { this.write(0); },
|
|
write: function(v) { g.setColor((this._v=!!v)?"#f00":g.theme.bg).fillCircle((g.getWidth()-20)/2,5,5);Bangle.setLCDPower(1); },
|
|
toggle: function() { this.write(!this._v); }
|
|
};
|
|
})
|