Hey everyone,
I'm using the Espruino Pico's real time clock for my clock project. Basically when I press the button, the Pico shows the time on some 7-segment LEDs for about a second and goes back to deep sleep.
function data() {
full=(new Date()).toString();
words = full.split(' ');
month = words[1];
date = words[2];
bigtime = words[4];
small = words[4].split(':');
hour = small[0];
if (hour > 12) {
hour = hour-12;
}
min = small[1];
}
function hourDriver(){
data();
switch(Number(hour)) {
//some code
}
}
function minuteDriver(){
data();
switch(Number(min)) {
//some code
}
}
setWatch(function (e) {
data();
for(i=0;i<60;i++){hourDriver();minuteDriver();}
allClear(); //initializes 7-segment display
setDeepSleep(1);
}, B8, {edge:"falling", repeat:true, debounce:50});
No matter what I do, the time seems to be drifting off about 5 to 10 minutes after a full day of use. What did I do wrong??? Or is the Pico's clock not the most accurate?
Thanks!
If you want the entire code it's in the comment below.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hey everyone,
I'm using the Espruino Pico's real time clock for my clock project. Basically when I press the button, the Pico shows the time on some 7-segment LEDs for about a second and goes back to deep sleep.
No matter what I do, the time seems to be drifting off about 5 to 10 minutes after a full day of use. What did I do wrong??? Or is the Pico's clock not the most accurate?
Thanks!
If you want the entire code it's in the comment below.