Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //always ran
- E.setFlags({pretokenise:1});
- if (!NRF.getSecurityStatus().connected) {
- E.setConsole(null,{force:true});
- NRF.sleep();
- } else {
- Bluetooth.setConsole(true);
- }
- Bangle.setLCDTimeout(60);
- Bangle.setLCDBrightness(0.1);
- E.setTimeZone(1);
- var options = {
- "wakeOnBTN1":true,
- "wakeOnBTN2":false,
- "wakeOnBTN3":false,
- "wakeOnFaceUp":false,
- "wakeOnTouch":false,
- "wakeOnTwist":false,
- "twistThreshold":30000,
- "twistMaxY":-800,
- "twistTimeout":1000
- };
- Bangle.setOptions(options);
- delete options;
- E.getBattery = function(){
- v = analogRead(30);
- const vlo = 0.50366211;
- const vhi = 0.63476562;
- pc = (v-vlo)*100/(vhi-vlo);
- if (pc>100) pc=100;
- if (pc<0) pc=0;
- return Math.round(pc);
- };
- Bangle.obuzz = Bangle.buzz;
- Bangle.buzz = function(time,strength){
- return Bangle.obuzz(time,1.0);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement