I'm trying to put my arduino on sleep with the same button but it's not working out.
Since I'm using interrupts, the source is independent so when i press the button i automatically wake and sleep it up.
I placed a delay() after pressing the button to enter the sleep mode, it works since it's on the loop function. But when i use the delay inside the interrupt it doesn't work out and it goes on and of right away
This is my attempt to reset it after the button on pin 2 (with a pullup resistor) gets pressed again (still doesn't work)
If you want to "sleep" and wake with one button, then you need to fully debounce the button in both the press and release - you only sleep after the release has been fully debounced, not the press.
BTW, something is not right, my arduino out of sleeping consumes 30.4mA and on sleeping 24.1mA. Might this be because it's a Chinese replica, or i have something wrong?
(I'm using arduino Pro mini v3)
tsunamy_boy: BTW, something is not right, my arduino out of sleeping consumes 30.4mA and on sleeping 24.1mA. Might this be because it's a Chinese replica, or i have something wrong?
(I'm using arduino Pro mini v3)
tsunamy_boy:
Thank you, yeh it looks like it makes sense now.
Is there a way to put the arduino on sleep with another IC specifically for that?
I must not understand your question. The ATmega328P microcontroller in the Arduino Pro Mini is specifically designed to sleep. In fact, it has six different sleep modes and at least as many wake-up sources. See section 10 in the datasheet.