Skip to content

Commit

Permalink
Number of RGB pixels added as a global constant.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathertel committed Dec 10, 2015
1 parent 1e13790 commit f795919
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions examples/DMXSerialFlow/DMXSerialFlow.ino
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ const int RedPin = 9; // PWM output pin for Red Light.
const int GreenPin = 6; // PWM output pin for Green Light.
const int BluePin = 5; // PWM output pin for Blue Light.

// The number of RGB pixels, RGB channels are transfered
#define PIXELS 60

void setup(void)
{
// Serial.begin(57600); // only on Leonardo
// Serial.println("DMXSerialFlow DMX Example");

DMXSerial.init(DMXController);
// DMXSerial.init(DMXController, 4);

// Set the number of channels the controller will send
// this call is not needed, because the DMXController extends the DMX packet length automatically when data is added.
Expand Down Expand Up @@ -81,7 +84,7 @@ void loop(void)
// uncomment this line to have a scenario where DMX values are changed every 5 seconds
// alpha &= 0xFF00;

for (int n = 0; n < 20; n++) {
for (int n = 0; n < PIXELS; n++) {
setChannelRGB (n*3+1, alpha + n*64);
} // for

Expand All @@ -95,4 +98,4 @@ void loop(void)





0 comments on commit f795919

Please sign in to comment.