-
-
Hey everyone,
I just wanted to clarify something, will the MDBT42Q bare module run perfectly wired to just a CR1225 coin cell? With no voltage regulator, just the battery to the module? I'm assuming it is but I just wanted to clear things up. I don't have a module to try it on, sorry.Thanks!
P.S. Will i be able to program the MDBT42Q with mbed?
-
-
-
-
-
Hey y'all,
I'm thinking of using a neopixel in my project and I know that they use about 1 mah when turned off by the controller chip. I'm only going to use a single pixel anyways, so if I connect the neopixel's power to an IO pin and only provide power when I'm actually going to use it, will I be able to save the 1mah and thus improve battery life?Thanks! :)
-
-
-
Oh well. I guess I'll use the MDBT42Q module for my future projects then.
Is there any way for the pico to keep accurate time then? I found out that the pico tends to be about a minute late every 43 minutes from calibration. Will it be possible to write code to add a minute to the time every 43 minutes? Is it even possible?Thanks!
-
-
var dg1 = A8; var dg2 = B7; var A = B14; var B = B13; var C = B10; var D = B1; var E = A7; var F = A6; var G = A5; var DP = B15; function allClear() { digitalWrite(A , 0); digitalWrite(B , 0); digitalWrite(C , 0); digitalWrite(D , 0); digitalWrite(E , 0); digitalWrite(F , 0); digitalWrite(G , 0); digitalWrite(DP , 0); digitalWrite(A8, 1); digitalWrite(B7, 1); } /* A little help? ----A---- | | F B | | ----G---- | | E C | | ----D---- */ function one() { digitalWrite(F, 1); digitalWrite(E, 1); } function two() { digitalWrite(A, 1); digitalWrite(B, 1); digitalWrite(G, 1); digitalWrite(E, 1); digitalWrite(D, 1); } function three() { digitalWrite(A, 1); digitalWrite(B, 1); digitalWrite(G, 1); digitalWrite(C, 1); digitalWrite(D, 1); } function four() { digitalWrite(F, 1); digitalWrite(G, 1); digitalWrite(B, 1); digitalWrite(C, 1); } function five() { digitalWrite(A, 1); digitalWrite(F, 1); digitalWrite(G, 1); digitalWrite(C, 1); digitalWrite(D, 1); } function six() { digitalWrite(A, 1); digitalWrite(F, 1); digitalWrite(E, 1); digitalWrite(G, 1); digitalWrite(C, 1); digitalWrite(D, 1); } function seven() { digitalWrite(F, 1); digitalWrite(A, 1); digitalWrite(B, 1); digitalWrite(C, 1); } function eight() { digitalWrite(A, 1); digitalWrite(B, 1); digitalWrite(C, 1); digitalWrite(D, 1); digitalWrite(E, 1); digitalWrite(F, 1); digitalWrite(G, 1); } function nine() { digitalWrite(A, 1); digitalWrite(B, 1); digitalWrite(C, 1); digitalWrite(G, 1); digitalWrite(F, 1); } function zero() { digitalWrite(A, 1); digitalWrite(B, 1); digitalWrite(C, 1); digitalWrite(D, 1); digitalWrite(E, 1); digitalWrite(F, 1); } function aa() { digitalWrite(A, 1); digitalWrite(B, 1); digitalWrite(C, 1); digitalWrite(E, 1); digitalWrite(F, 1); digitalWrite(G, 1); } function bb() { digitalWrite(C, 1); digitalWrite(D, 1); digitalWrite(E, 1); digitalWrite(F, 1); digitalWrite(G, 1); } function cc() { digitalWrite(A, 1); digitalWrite(F, 1); digitalWrite(E, 1); digitalWrite(D, 1); } 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]; } /* digitalWrite(A8, 1); digitalWrite(B7, 0); three(); allClear(); digitalWrite(A8, 0); digitalWrite(B7, 1); five(); allClear(); */ function hourDriver() { data(); switch (Number(hour)) { case 00: case 12: allClear();digitalWrite(A8, 0); cc(); break; case 01: allClear();digitalWrite(A8, 0); one(); break; case 02: allClear();digitalWrite(A8, 0); two(); break; case 03: allClear();digitalWrite(A8, 0); three(); break; case 04: allClear();digitalWrite(A8, 0); four(); break; case 05: allClear();digitalWrite(A8, 0); five(); break; case 06: allClear();digitalWrite(A8, 0); six(); break; case 07: allClear();digitalWrite(A8, 0); seven(); break; case 08: allClear();digitalWrite(A8, 0); eight(); break; case 09: allClear();digitalWrite(A8, 0); nine(); break; case 10: allClear();digitalWrite(A8, 0); aa(); break; case 11: allClear();digitalWrite(A8, 0); bb(); break; } } function minuteDriver() { data(); switch(Number(min)) { case 00: case 01: case 02: case 03: case 04: allClear();digitalWrite(B7, 0); break; case 05: case 06: case 07: case 08: case 09: allClear();digitalWrite(B7, 0); digitalWrite(G, 1); break; case 10: case 11: case 12: case 13: case 14: allClear();digitalWrite(B7, 0); digitalWrite(F, 1); break; case 15: case 16: case 17: case 18: case 19: allClear();digitalWrite(B7, 0); digitalWrite(F, 1); digitalWrite(G, 1); break; case 20: case 21: case 22: case 23: case 24: allClear();digitalWrite(B7, 0); digitalWrite(A, 1); break; case 25: case 26: case 27: case 28: case 29: allClear();digitalWrite(B7, 0); digitalWrite(A, 1); digitalWrite(G, 1); break; case 30: case 31: case 32: case 33: case 34: allClear();digitalWrite(B7, 0); digitalWrite(B, 1); break; case 35: case 36: case 37: case 38: case 39: allClear();digitalWrite(B7, 0); digitalWrite(B, 1); digitalWrite(G, 1); break; case 40: case 41: case 42: case 43: case 44: allClear();digitalWrite(B7, 0); digitalWrite(C, 1); break; case 45: case 46: case 47: case 48: case 49: allClear();digitalWrite(B7, 0); digitalWrite(C, 1); digitalWrite(G, 1); break; case 50: case 51: case 52: case 53: case 54: allClear();digitalWrite(B7, 0); digitalWrite(D, 1); break; case 55: case 56: case 57: case 58: case 59: allClear();digitalWrite(B7, 0); digitalWrite(D, 1); digitalWrite(G, 1); break; } } function random(state) { if (state === true || state === 1) { clearTimeout(); random(); } else if (state === false || state === 0) { allClear(); clearTimeout(); setDeepSleep(1); return; } var what = Math.floor((Math.random() * 3)); if (what === 0) { allClear(); } else if (what == 1 || what == 2) { digitalWrite(A, Math.floor((Math.random() * 2))); digitalWrite(B, Math.floor((Math.random() * 2))); digitalWrite(C, Math.floor((Math.random() * 2))); digitalWrite(D, Math.floor((Math.random() * 2))); digitalWrite(E, Math.floor((Math.random() * 2))); digitalWrite(F, Math.floor((Math.random() * 2))); digitalWrite(G, Math.floor((Math.random() * 2))); } setTimeout(random, ((Math.random() * 1000) + 1)); } function swirl() { for (delay=35;delay>0;delay=delay-2) { digitalWrite(B14, 0); digitalWrite(B13, 1); digitalPulse(A1, 1, delay); digitalWrite(B13, 0); digitalWrite(B10, 1); digitalPulse(A1, 1, delay); digitalWrite(B10, 0); digitalWrite(B1, 1); digitalPulse(A1, 1, delay); digitalWrite(B1, 0); digitalWrite(A7, 1); digitalPulse(A1, 1, delay); digitalWrite(A7, 0); digitalWrite(A6, 1); digitalPulse(A1, 1, delay); digitalWrite(A6, 0); digitalWrite(B14, 1); digitalPulse(A1, 1, delay); } digitalWrite(B14, 0); for (i=0;i<8;i++){ digitalWrite(D, 0); digitalWrite(A, 1); digitalPulse(A1, 1, 90); digitalWrite(A, 0); digitalWrite(G, 1); digitalPulse(A1, 1, 90); digitalWrite(G, 0); digitalWrite(D, 1); digitalPulse(A1, 1, 90); } } //var l = false; //setWatch( function(e) { l=!l; random(l);}, B8, {repeat:true, edge:'falling', debounce:100}); function onInit() { data(); digitalWrite(A8,0); digitalWrite(B7,0); swirl(); digitalWrite(D, 0); setDeepSleep(1); } pinMode(B8, 'input_pullup'); pinMode(B5, 'input_pullup'); setWatch(function (e) { data(); for(i=0;i<60;i++){hourDriver();minuteDriver();} allClear(); setDeepSleep(1); }, B8, {edge:"falling", repeat:true, debounce:50}); /* var state = false; setWatch(function (e) { state=!state; random(state); setDeepSleep(1); }, B5, {edge:"falling", repeat:true, debounce:50}); */ setInterval(function(e) { data(); }, 1800000); setDeepSleep(1); save();
-
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.
-
-
-
Oh another question, how do I turn a function on and off using only one button?
For now I have individual on/off buttons but I would like to use just one.
I've tried var l;function(l=!l) and similar methods but they all don't seem to work.pinMode(B8, 'input_pullup'); pinMode(B5, 'input_pullup'); function random(state) { if (state === true || state === 1) { random(); } else if (state === false || state === 0) { allClear(); clearTimeout(); setDeepSleep(1); return; } digitalWrite(A8, 0); digitalWrite(B7, 0); //var num = Math.floor((Math.random() * 10)); //var sec = ((Math.random() * 0.5) + 1) * 1000; var what = Math.floor((Math.random() * 3)); if (what === 0) { allClear(); } else if (what == 1 || what == 2) { digitalWrite(A, Math.floor((Math.random() * 2))); digitalWrite(B, Math.floor((Math.random() * 2))); digitalWrite(C, Math.floor((Math.random() * 2))); digitalWrite(D, Math.floor((Math.random() * 2))); digitalWrite(E, Math.floor((Math.random() * 2))); digitalWrite(F, Math.floor((Math.random() * 2))); digitalWrite(G, Math.floor((Math.random() * 2))); } setTimeout(random, ((Math.random() * 701) + 1)); setWatch( function(e) { random(false); }, B8, {repeat:true, edge:'falling', debounce:100}); } setWatch( function(e) { clearTimeout(); random(true); }, B5, {repeat:true, edge:'falling', debounce:100}); setDeepSleep(1);
-
-
Hi everyone,
I would like to know if my Charlieplexed LED matrix needs to be arranged in a specific way to work.
For example, do I need to go top to bottom and left to right? or bottom to top and right to left? or bottom to top and left to right? Does it even matter? And if I get my arrangement wrong, can I still display graphics the right way up by rotating the graphics?Thanks!
EDIT: Also, can the charlieplex library display text and images as long as I provide the width and length? Or do I need to arrange my LEDs in a certain width/height to use the bitmap fonts? Thanks again!
-
-
-
-
-
-
I tried loading custom firmware onto the pico. The firmware doesn't work. No problem, I can just load Espruino on it, which I successfully do. I load a sample .js file and run it, and no problem, it runs just fine.
However, about 40 minutes later, it stops working. During those 40 minutes I didn't touch the Pico at all and it wasn't hooked up to any power source.
What do you mean by that? The MDBT42 docs page says it accepts 1.7-3.6v range.
Do you mean multiplexing and using persistence of vision?