arscripter
A web-based approach to rapid Arduino prototyping. Program your Arduino board straight from the browser using JavaScript and GUI controls.
Requirements
Installation
npm install -g arscripter
Usage
- Connect Arduino via USB
- Execute
arscripter
- Navigate to
http://localhost:8080
in web browser
- Toggle the mode and/or value of a pin by clicking on the appropriate label
- PWM values can be set via the adjacent slider
- Analog values can be viewed in the adjacent graph
API
-
loop(ms, handler())
Execute thehandler
function everyms
milliseconds -
display(msg)
Printmsg
to the output pane -
getPinValue(pin)
Returns the current value of the givenpin
-
setPinValue(pin, value)
Write avalue
to a givenpin
-
toggleDigitalValue(pin)
Write the opposite of the current value of a givenpin
-
getPinMode(pin)
Returns the current mode of the givenpin
-
setPinMode(pin, mode)
Set the mode of a givenpin
, one of the possible pin modes (see below)
Pin Modes
0
: Input1
: Output2
: Analog3
: PWM
Basic Script
var pin = 13;; ;
Notes
- The first analog pin is reached at the number following the last digital pin (e.g. the last digital pin on the Uno is pin 13, so A0 is pin 14).