You could stick it in your connectDevice function yes (leaving the reset() part in and just changing the code it uploads).
Otherwise you could remove the reset and upload the code to the Puck separately - which would allow you to maybe keep a history of movement in the Puck and initially populate the graph.
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.
try just
elements.movement.setValue(j)
?You could stick it in your connectDevice function yes (leaving the
reset()
part in and just changing the code it uploads).Otherwise you could remove the
reset
and upload the code to the Puck separately - which would allow you to maybe keep a history of movement in the Puck and initially populate the graph.