0.4.0 • Published 5 years ago
adafruit-neotrellis v0.4.0
NeoTrellis
Examples
const NeoTrellis = require('adafruit-neotrellis');
const trellis = new NeoTrellis();
trellis.on('Button0', () => {
// button 0 pressed
});
trellis.on('press', data => {
// any button pressed
// number is the button pressed
const { number } = data;
});
// change button 0 to red
// (index, r, g, b)
trellis.changeColor(0, 255, 0, 0)
API
.changeColor(index, r, g, b)
index
- the buttons indexr
the red valueb
the blue valueg
the green value
Events
ButtonX
- fired whenButtonX
is pressed whereX
is the buttons indexpress
- fired when any button is pressed