How to disable reset button? #5158
Replies: 1 comment
-
Posted at 2015-11-19 by @gfwilliams Thanks! The reset button is physically connected to the reset pin of the board, so it can't be overwritten in software, but you have two options. Use the internal RTCThis is actually what you're doing currently, and the internal RTC will keep time between resets. The problem is that the RTC is only 24 bit, and when you use the To get around it, you can turn off that setting in the Web IDE and can instead store the time since startup (the default) and then add that to a variable that you create which is the time at which you started Espruino. The http://www.espruino.com/clock module will do that for you. Disable the hard reset buttonYou might want to do this anyway, as if you're writing to an SD and just hit reset, it could corrupt it. It's pretty easy - if you look at the See the attached image - just cut across with a sharp blade where I made the red mark reset will stop working. If you want to re-enable it, just put a blob of solder between those two pads. You can also put a blob of solder on the two pads to the left, and then you can use that extra button on pin C12 (but you need to either add a resistor or run Attachments: Posted at 2015-11-19 by CoffeeCups Yup, that scalpel cut did it. Nice to know how to reuse or re-purpose reset button too. Me searching for RST instead of 'reset' might have yielded the find. Thanks for the nice fast reply and saving me from the very nasty alternative I was dreaming up involving hot-glue and an old led cover. My comments re RTC were because I can see them removing the battery too, sticking a charger in the project should negate that. Reset maintains clock, good to know. Cheers Posted at 2015-11-19 by @gfwilliams Ok, great! You know there's space for a LiPo charger IC on the board too? Just take a MAX1551 and solder it on, then as long as you have a LiPo battery, when they plug the board into USB it'll get charged :) Posted at 2015-11-19 by CoffeeCups No I did not know that, I will look further into it. Third stage prototype will involve 2 units one to sensor and transmit (Pico), the other to receive and log. I really wanted to cut my teeth on straight Espruino standard boards first. Looking at both BT and RF units right next. Your site has some really good info on fixing these in, I like the videos. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2015-11-19 by CoffeeCups
I've searched everywhere and cannot find a solution to this.
I have someone in the real world testing an Espruino with a sensor and logging. Its only a second stage prototype and at this stage I don't want to add an RTC, so the time is hard coded as the prog is save()d when init is run.
I have programmed BTN1 to allow them to unmountSD, but am scared that they will press reset, and send the time back to the hard-coded one I just mentioned.
I thought I'd found the answer on this thread with
var reset=0;
but it does not work.How can I disable, or redirect a button press on the Reset button?
I read this on the Adafruit description :
But am unsure how to do that. It seems a bit drastic, but I will do/undo it if necessary.
Thanks for any ideas - loving my Espruinos by the way, great project.
Espruino 1.4 with 1v81.
Beta Was this translation helpful? Give feedback.
All reactions