Advertisement
Guest User

Arduino White Colors

a guest
Feb 28th, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1.  
  2. int redArray[] = {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 249, 247, 245, 243, 240, 239, 237, 235, 233, 231, 230, 228, 227, 225, 224, 222, 221, 220, 218, 217, 216, 215, 214, 212, 211, 210, 209, 208, 207, 207, 206, 205, 207, 207, 206, 205, 204, 204, 203, 202, 202, 201, 200, 200, 199, 198, 198, 197, 97, 97, 196, 196, 195};
  3. int greenArray[] = {56, 71, 83, 93, 101, 109, 115, 121, 126, 131, 138, 142, 147, 152, 157, 161, 165, 169, 173, 177, 180, 184, 187, 190, 193, 196, 199, 201, 204, 206, 209, 211, 213, 215, 217, 219, 221, 223, 225, 227, 228, 230, 232, 233, 235, 236, 238, 239, 240, 242, 243, 244, 245, 246, 248, 249, 249, 247, 246, 245, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 230, 229, 229, 227, 227, 226, 225, 225, 224, 223, 223, 222, 221, 221, 220, 220, 219, 218, 217, 217, 216, 216, 215, 215, 214, 214, 213, 213, 212, 212, 212, 211, 211, 210, 210, 210, 209};
  4. int blueArray[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 33, 44, 54, 63, 72, 79, 87, 94, 101, 107, 114, 120, 126, 132, 137, 143, 148, 153, 159, 163, 168, 173, 177, 182, 186, 190, 194, 198, 202, 206, 210, 213, 217, 220, 224, 227, 230, 233, 236, 239, 242, 245, 247, 251, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255};
  5.  
  6. int potPin = A0;
  7. int potVal;
  8.  
  9. void setup() {
  10.  
  11. Serial.begin(9600);
  12.  
  13. strip.begin();
  14. strip.show();
  15.  
  16. }
  17.  
  18. void loop() {
  19.  
  20. potVal = map(analogRead(potPin), 0, 1023, 0, 109);
  21.  
  22.  
  23. uint32_t change = strip.Color(redArray[potVal], greenArray[potVal], blueArray[potVal]);
  24.  
  25. for( int i = 0; i<NUM_LIGHTS; i++){
  26. strip.setPixelColor(i, change);
  27. strip.show();
  28. }
  29.  
  30.  
  31.  
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement