Inspired by @JumJum 's work, I made a UI to my stepper code using Espruino IDE's testing plug-in.
What is the benefit or convenience of using the test UI to operate your Espruino (while connected): You just click a button vs. typing a code snippet in the console pane (terminal)... and most of the time mistyping it...
The test plug-in worked right away 'out of box' and without modifying my code (after creating a testing folder in the local sandbox folder).
For controlling the board, I created the actionPoints (using the UI in the left hand side):
stop - stop() - stop the stepper
r3 - r(3) - run with interval of 3[ms]
increaseInterval - r(...) - increase the stepping interval
decreaseInterval - r(...) - decrease the stepping interval
Because I wanted not just have the stepping interval graphed but also the (relative) speed, I just added a new variable stS (stepping speed) in my code that is updated when setting the interval stT variable (near setInterval() and clearInterval()) and use it in the test UI.
For the increase and decrease details, see code below, which does the increase/decrease dependent on current stepping value. Code taken from the testing folder after saving definitions in the UI - and formatted for clarity.
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.
#test #operate #UI #testing #IDE #plugin
Inspired by @JumJum 's work, I made a UI to my stepper code using Espruino IDE's testing plug-in.
What is the benefit or convenience of using the test UI to operate your Espruino (while connected): You just click a button vs. typing a code snippet in the console pane (terminal)... and most of the time mistyping it...
The test plug-in worked right away 'out of box' and without modifying my code (after creating a testing folder in the local sandbox folder).
For controlling the board, I created the actionPoints (using the UI in the left hand side):
Because I wanted not just have the stepping interval graphed but also the (relative) speed, I just added a new variable stS (stepping speed) in my code that is updated when setting the interval stT variable (near setInterval() and clearInterval()) and use it in the test UI.
For the increase and decrease details, see code below, which does the increase/decrease dependent on current stepping value. Code taken from the testing folder after saving definitions in the UI - and formatted for clarity.
In order to understand the speed value - this is the formula:
Attached is a screen shot of my operation and monitor UI for the stepper motor.
1 Attachment