Hi All,
I have a project where my code is looking for a button press and then excutes a routine.
I'm using the PICAXE-08M2
Currently my code looks like this
But I'm doing this with a small watch battery and the battery dies too quickly.
My question:
Is there a better way of doing this? Instead of using battery power constantly looking for the button push would my battery last longer if I used an interrupt or some other method?
Can I have my microcontroller sleep/hibernate or turn off until the button is pushed?
I have a project where my code is looking for a button press and then excutes a routine.
I'm using the PICAXE-08M2
Currently my code looks like this
Code:
main: if pinC.1 = 1 then timerbegin ; if button pressed start timer
pause 50 ; dbounce setting
goto main ; otherwise look for button push again
My question:
Is there a better way of doing this? Instead of using battery power constantly looking for the button push would my battery last longer if I used an interrupt or some other method?
Can I have my microcontroller sleep/hibernate or turn off until the button is pushed?