UNPKG

rpi-sk6812-native

Version:

(raspberry-pi *only*) native bindings to control a strip of WS281x or SK6812 LEDs with node.js

11 lines (9 loc) 235 B
module.exports = function(rows, cols) { var map = new Uint16Array(rows*cols); for(var x=0; x<cols; x++) { for(var y=0; y<rows; y++) { map[cols*y + x] = cols*y + rows-x-1; } } return map; };