If you do while(true) then the code won't exit and no other JS tasks will be able to get run - you'll have to Ctrl-C out of it. On Puck.js it's especially painful because it can't transmit that quickly, so
when you're outputting with console.log it's basically just stuck for 99% of the time waiting for the next Bluetooth send task to finish.
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.
Sure - you just specify a number in
Puck.magOn
, likePuck.magOn(5)
- see http://www.espruino.com/Reference#l_Puck_magOnWhat kind of overflow did you get?
If you do
while(true)
then the code won't exit and no other JS tasks will be able to get run - you'll have to Ctrl-C out of it. On Puck.js it's especially painful because it can't transmit that quickly, sowhen you're outputting with
console.log
it's basically just stuck for 99% of the time waiting for the next Bluetooth send task to finish.