Physical computing library for embedded Linux
Bonescript is a node.js library for physical computing on embedded Linux, starting with support for BeagleBone.
Information on the language is available at http://nodejs.org.
To get started, try running 'node blinkled.js' on a BeagleBone.
Additional documentation is available at http://beagleboard.org/bonescript.
BoneScript comes installed on your BeagleBone. To update to the latest revision or install it on another distribution, use 'npm':
TERM=none npm install -g bonescript
opkg updateopkg install python-misc python-modules
Support for other distributions is a work in progress.
To have your applications launch on startup, simply drop them into the /var/lib/cloud9/autorun folder. Moving them out of that folder will kill the processes. You are expected to only drop in already bug-free apps into this folder as there isn't a good way to perform debug on them.
There's still a lot of development going on, so be sure to check back on a frequent basis. Many of the fancier peripherals aren't yet supported except through performing file I/O.
For a Bonescript application, you must currently manually 'require' the bonescript library. Functions are then referenced through the object provided back from require.
Here's an example:
var b = require'bonescript';bpinMode'P8_12' bINPUT;bpinMode'P8_13' bOUTPUT;setIntervalcopyInputToOutput 100;bdigitalRead'P8_12' writeToOutput;bdigitalWrite'P8_13' xvalue;
The 'P8_12' and 'P8_13' are pin names on the board and the above example would copy the input value at P8_12 to the output P8_13 every 100 ms.
When a callback is provided, the functions will behave asynchronously. Without a callback provided, the functions will synchronize and complete before returning.