Created
January 27, 2015 20:14
-
-
Save meta1203/2a2dfb78a1cfd5f1a2a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var keyboard = require('msi-keyboard'); | |
var colors = ['red','yellow','green','sky','blue','purple']; | |
var reg1 = 0; | |
var reg2 = 1; | |
var reg3 = 2; | |
keyboard.color('left', colors[reg1]); | |
keyboard.color('middle', colors[reg2]); | |
keyboard.color('right', colors[reg3]); | |
keyboard.mode('normal'); | |
setInterval(function(){ | |
keyboard.color('left', colors[reg1]); | |
keyboard.color('middle', colors[reg2]); | |
keyboard.color('right', colors[reg3]); | |
reg1+=1; | |
reg2+=1; | |
reg3+=1; | |
if (reg1>5) { reg1=0; } | |
if (reg2>5) { reg2=0; } | |
if (reg3>5) { reg3=0; } | |
}, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment