Tessel Led
Help for controlling LEDs on the tessel board.
Install
npm install tessel-led --save
Usage
var led = ; ledblue; lederror; var group = ledblue ledgreen ledamber ledred; group index1 start;
Features
- Automatically resets all LEDs when exiting, like CTRL-C.
- Easier access to LEDs. via index, name, color, position
- Simple interface for blinking or flashing LEDs
- Flow control DSL to help with writing complex LED animations
- TODO: support for neopixel
LEDs
All LEDs on the tessel board are wrapped into a LED instance
You can access any of LEDs multiple ways.
LED (index: 0, name: led1, color: green, position: 3)
led0 ledled1 ledgreen led
LED (index: 1, name: led2, color: blue, position: 4)
led1 ledled2 ledblue led
LED (index: 2, name: error, color: red, position: 1)
led2 lederror ledred led
LED (index: 3, name: conn, color: amber, position: 2)
led3 ledconn ledamber led
show()
turns the LED on.
ledblue;
hide()
turns the LED off.
ledled2;
blink(duration, cb)
turns the LED on for specified duration. default = 100. Once complete fires optional callback.
ledgreen;
flash(times, duration, delay, cb)
flashes the LED on & off times
times. duration is the length the LED is on, default = 100. delay is the length the LED is off, default = 100. Once complete with all times
fires optional callback.
lederror;
LED.Group
Flow control class to help with chaining complex LED animations.