Most recent activity
-
Update for Espruino board since it only has 3 lights... Also added ability to stop and restart it. Change the value of
i
to control how fast the lights change (in milliseconds), by defaultrun=true
, setting tofalse
will stop it. You can now resume by settingrun=true
again. Enjoy!var i = 1000, run = true; function flashLights() { LED3.write(false); LED1.write(true); setTimeout(function () { LED1.write(false); LED2.write(true); setTimeout(function () { LED2.write(false); LED3.write(true); setTimeout(function () { if (run) { flashLights(); } else { var checkForRestart = setInterval(function () { if (run) { clearInterval(checkForRestart); flashLights(); } }, 500); } }, i); }, i); }, i); } flashLights();
-
Awesome, thanks for the very thorough response! I haven't received my Espruino (starter kit) yet, but I had bought an STM32F4Discovery a few months ago that I've been playing with in the mean time. I had written a small program to cycle the state (0 to 1 and back) of the A2 pin every 3 seconds on my board last night, and was checking it with a digital multi-meter to see if it was pulled to ground, but didn't realize that reading the pin value would cause it to float as the voltage never changed much. Guess I should've used an analog meter to see it "bounce" from being pulled to ground. I was doing
console.log(A2.read())
immediately after setting the pin, so it was probably too fast for the digital meter to pick up that it gained or lost voltage before floating.Hopefully I can wire it directly like you have mentioned above that would be preferable (and what I was attempting last night), if not then I'll go the relay route. I'm pretty sure the 2nd wire on reset is chassis ground, I'll check tonight after work...
-
What's the easiest way to "connect" 2 pins? Should I use digitalWrite, pin.write with a timeout, analogWrite, or something else? Also should I use 2 pins, or can I use 1 pin with ground? I'm wanting to use Espruino to "press" the reset button on a PC by wiring the green/black wires to it...
Thanks,
Austin -
-
-
-
So I've checked my PC, the reset pin is indeed being grounded from 3v3... And was able to test the Espruino board (just got the "official" one last night), that the C8 pin when trigger will "short" the pin to ground. So that'll work out perfectly! Thanks again for the hlep
Cheers,
Austin