//DmxRecv_Calibr, V02, 04-jun-2016 //DMX receiving program by RoBernd www.radonmaster.de/dancingwater //Test program to check the function of DMXControl via interface Velleman VM116/K8062 //This Arduino sketch receives light intensity levels for 12 LEDs via DMX-bus //The transmitted raw intensity levels are calibrated into more realistic levels //by a calibration table. //DmxSerial - DMX-I/O-library by Matthias Hertel, http://www.mathertel.de #include //DMX address-range 01-12 //basic DMX address #define basad 1 //output pin number table //LED number counts from 0 to 11. The assosiated DMX address counts from 1 to 12 int ledpin[] {3,4,5,6,7,8,9,10,11,12,13,2}; //for arduino mega 2560 // int ledpin[] {3,5,6,9,10,11,3,5,6,9,10,11}; //for arduino uno int i; //index #define istart 0 //for arduino mega 2560 #define iend 12 //for arduino mega 2560 // #define istart 0 //for arduino uno #1 // #define iend 6 //for arduino uno #1 // #define istart 6 //for arduino uno #2 // #define iend 12 //for arduino uno #2 byte intensity; //light intensity //calibration table for LED light, table is calculated in logarithmic order //the original received byte is index for this table byte calib[] {0,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,3,3,3,3, 3,3,3,3,3,3,3,3, 3,3,3,4,4,4,4,4, 4,4,4,4,4,4,5,5, 5,5,5,5,5,5,5,5, 6,6,6,6,6,6,6,7, 7,7,7,7,7,7,8,8, 8,8,8,8,9,9,9,9, 9,10,10,10,10,11,11,11, 11,12,12,12,12,13,13,13, 13,14,14,14,15,15,15,16, 16,16,17,17,17,18,18,19, 19,19,20,20,21,21,22,22, 23,23,24,24,25,25,26,26, 27,28,28,29,29,30,31,31, 32,33,34,34,35,36,36,37, 38,38,40,41,42,43,44,45, 46,47,48,49,50,51,52,53, 54,55,57,58,59,60,62,63, 65,66,67,69,70,72,74,75, 77,79,80,82,84,86,88,89, 91,93,96,98,100,102,104,107, 109,111,114,116,119,121,124,127, 130,133,135,138,141,145,148,151, 154,158,161,165,168,172,176,180, 184,188,192,196,201,205,210,214, 219,224,229,234,239,244,249,255}; void setup () { DMXSerial.init(DMXReceiver); // enable pwm outputs for (i=istart;i