mountain-displaypad
is a Node.js library for interfacing
with Mountain's 6×2 button Displaypad.
❗ Please note that
mountain-displaypad
is NOT a standalone application. Instead,mountain-displaypad
is a code library, which developers can use to make their own applications which interface with the Displaypad.
This library is based on infinitton-idisplay
, which is a modified version of elgato-stream-deck
that does not have dependencies to image libraries, and that talks to the Infinitton device instead of the Elgato Stream Deck.
$ npm install --save mountain-displaypad
const Displaypad = require('./mountain-displaypad')
pad = new Displaypad()
pad.on('up', (key) => {console.log('Button up:', key)})
pad.on('down', (key) => {console.log('Button down:', key)})
pad.clearAllKeys()
pad.fillColor(0, 255, 0, 0)
pad.fillColor(1, 0, 255, 0)
pad.fillColor(2, 0, 0, 255)
// Create a new image with a light red line from the top left to the bottom right corner
image = Buffer.alloc(Displaypad.ICON_SIZE * Displaypad.ICON_SIZE * 3)
for (let i = 0; i < Displaypad.ICON_SIZE; i++) {
offset = i * Displaypad.ICON_SIZE * 3 + i * 3
image[offset] = 0xff
image[offset+1] = 0x7f
image[offset+2] = 0x7f
}
pad.fillImage(9, image)
const Displaypad = require('./mountain-displaypad')
async function main() {
pad = await Displaypad.openAsync()
pad.on('up', (key) => {console.log('Button up:', key)})
pad.on('down', (key) => {console.log('Button down:', key)})
pad.fillColor(0,255,0,0)
pad.fillColor(1,0,255,0)
pad.fillColor(2,0,0,255)
}
main()