Licence
MIT
Version
0.6.5
Deps
3
Vulns
2
Weekly
0
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:8080in 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 thehandlerfunction everymsmillisecondsdisplay(msg)
Printmsgto the output panegetPinValue(pin)
Returns the current value of the givenpinsetPinValue(pin, value)
Write avalueto a givenpintoggleDigitalValue(pin)
Write the opposite of the current value of a givenpingetPinMode(pin)
Returns the current mode of the givenpinsetPinMode(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;
setPinMode(pin,1);
loop(1000, function() {
toggleDigitalValue(pin);
setTimeout(function() {
display('Pin ' + pin + ' value: ' + getPinValue(pin) + '\n');
}, 10);
});
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).