Shop OBEX P1 Docs P2 Docs Learn Events
Sleep Mode to save battery life? — Parallax Forums

Sleep Mode to save battery life?

Luis_PLuis_P Posts: 246
edited 2010-02-05 19:25 in BASIC Stamp
· How can I save the battery life of Bs1 ? I have a remote control ON all the time, I want to put the BS1 to sleep and wake up when Button is pressed so the 2 coin batteries (6V total) last longer.

Thanks!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-02-05 19:25
    There is no way to wake up the BS1 when a button is pressed, but the BS1 can spend most of its time in sleep mode using NAP and wake up a few times a second to check whether a button is pressed, then go back to sleep if not. You didn't say how many buttons you're using or how they're connected, but a common technique is to sample all the buttons at once (by looking at all their bits in PINS). If they're not all zero or all ones, the BS1 goes on to check them one at a time and debounce each as needed. While in sleep mode, the power consumption goes way down. The BS1 could take 1-2ms every 250ms to check the buttons with its average power consumption going down by a factor of 100.

    Post Edited (Mike Green) : 2/5/2010 7:32:28 PM GMT
Sign In or Register to comment.