switch off/on or restart function on Espruino?

Posted on
  • hi, I wonder how to write some switch off/on function on my Espruino,
    I use OLED ssd1306 and ADS1115 for low voltage readings and display them into OLED,
    would like to switch off my Espruino for battery saving when I don't use it,
    I know I can write some clear() function for OLED when I press button and send some low voltage for ADS vcc pin but maybe there is some simple solution?
    is there any function I can use?

  • Perhaps read up on DeepSleep and have a watch toggle it and clear the OLED.

  • You don't even have to toggle setDeepSleep - once turned on, Espruino will wake up and go to deep sleep automatically - unless you use Serial ports or PWM you shouldn't notice any difference apart from reduced power consumption.

    You can't turn Espruino off in software yet, but to be honest the difference in power consumption between being off and in deep sleep is quite small.

  • i don't want to use mechanical switch, oled and pico would be in the housing, I thought to use some piezzo switch to "make it work or sleep", so I can't simply turn off the pico

  • Usually, when working with a modern microcontroller, it doesn't turn off. When it's "off", it's in sleep with everything else turned off, set to wake on button press.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

switch off/on or restart function on Espruino?

Posted by Avatar for bigplik @bigplik

Actions