From f79591913718d247c52e311b73446cb58e98a959 Mon Sep 17 00:00:00 2001 From: Matthias Hertel Date: Thu, 10 Dec 2015 20:41:06 +0100 Subject: [PATCH] Number of RGB pixels added as a global constant. --- examples/DMXSerialFlow/DMXSerialFlow.ino | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/DMXSerialFlow/DMXSerialFlow.ino b/examples/DMXSerialFlow/DMXSerialFlow.ino index 489d03f..cf97a01 100644 --- a/examples/DMXSerialFlow/DMXSerialFlow.ino +++ b/examples/DMXSerialFlow/DMXSerialFlow.ino @@ -21,6 +21,8 @@ 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) { @@ -28,6 +30,7 @@ void setup(void) // 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. @@ -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 @@ -95,4 +98,4 @@ void loop(void) - +