SHARE
TWEET

Untitled

a guest Sep 22nd, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 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
  2. int VARIABLES[ARRAY_SIZE]={ circuit1,circuit2,circuit3,circuit4,circuit5,circuit6,status }
  3.  
  4. void ledupdate() {
  5.     for (int i=0; i<ARRAY_SIZE; i++) {
  6.         switch(VARIABLES[i]) {
  7.             case 0:
  8.                 batterypixels.setPixelColor(i, batterypixels.Color(0, 0, 0));
  9.                 break;
  10.             case 1:
  11.                 batterypixels.setPixelColor(i, batterypixels.Color(0, 10, 0));
  12.                 break;    
  13.             case 2:
  14.                 batterypixels.setPixelColor(i, batterypixels.Color(10, 10, 0));
  15.                 break;    
  16.             case 3:
  17.                 batterypixels.setPixelColor(i, batterypixels.Color(10, 0, 0));
  18.                 break;
  19.         }
  20.     }
  21.     batterypixels.show();
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top