Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const int ARRAY_SIZE = 8; // Base Array sizes are always 1 bigger than the actual content of the array. The "extra" is a termination/null character
- int VARIABLES[ARRAY_SIZE]={ circuit1,circuit2,circuit3,circuit4,circuit5,circuit6,status }
- void ledupdate() {
- for (int i=0; i<ARRAY_SIZE; i++) {
- switch(VARIABLES[i]) {
- case 0:
- batterypixels.setPixelColor(i, batterypixels.Color(0, 0, 0));
- break;
- case 1:
- batterypixels.setPixelColor(i, batterypixels.Color(0, 10, 0));
- break;
- case 2:
- batterypixels.setPixelColor(i, batterypixels.Color(10, 10, 0));
- break;
- case 3:
- batterypixels.setPixelColor(i, batterypixels.Color(10, 0, 0));
- break;
- }
- }
- batterypixels.show();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement