Skip to main content
1 of 2
Igor Stoppa
  • 2.1k
  • 1
  • 15
  • 20

Here's a sample program you could use as reference, just replace the values in the array and adjust VALUES_NUMBER accordingly.

Disclaimer: I didn't try to compile/run it, but it should give you an idea of how to use the values you already have.

// These are Arduino Pins that support "analog" output. unsigned short analogRed = 3; unsigned short analogGreen = 5; unsigned short analogBlue = 6; const unsigned int VALUES_NUMBER = 12; const unsigned short REDS[VALUES_NUMBER] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B }; const unsigned short GREENS[VALUES_NUMBER] = { 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05 }; const unsigned short BLUES[VALUES_NUMBER] = { 0x09, 0x0A, 0x0B, 0x03, 0x04, 0x05, 0x00, 0x01, 0x02, 0x06, 0x07, 0x08 }; void setup() { pinMode(analogRed, OUTPUT); pinMode(analogGreen, OUTPUT); pinMode(analogBlue, OUTPUT); } void loop() { unsigned int counter; for (counter = 0; counter < VALUES_NUMBER; counter++) { analogWrite(analogRed, REDS[counter]); analogWrite(analogGreen, GREENS[counter]); analogWrite(analogBlue, BLUES[counter]); delay(1000); //sleep 1 second } } 
Igor Stoppa
  • 2.1k
  • 1
  • 15
  • 20