Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Conceptinetics.h>
- //
- // CTC-DRA-13-1 ISOLATED DMX-RDM SHIELD JUMPER INSTRUCTIONS
- //
- // If you are using the above mentioned shield you should
- // place the RXEN jumper towards G (Ground), This will turn
- // the shield into read mode without using up an IO pin
- //
- // The !EN Jumper should be either placed in the G (GROUND)
- // position to enable the shield circuitry
- // OR
- // if one of the pins is selected the selected pin should be
- // set to OUTPUT mode and set to LOGIC LOW in order for the
- // shield to work
- //
- //
- // The slave device will use a block of 10 channels counting from
- // its start address.
- //
- // If the start address is for example 56, then the channels kept
- // by the dmx_slave object is channel 56-66
- //
- #define DMX_SLAVE_CHANNELS 10
- //
- // Pin number to change read or write mode on the shield
- // Uncomment the following line if you choose to control
- // read and write via a pin
- //
- // On the CTC-DRA-13-1 shield this will always be pin 2,
- // if you are using other shields you should look it up
- // yourself
- //
- // Configure a DMX slave controller
- DMX_Slave dmx_slave ( DMX_SLAVE_CHANNELS );
- // If you are using an IO pin to control the shields RXEN
- // the use the following line instead
- ///// DMX_Slave dmx_slave ( DMX_SLAVE_CHANNELS , RXEN_PIN );
- const int ledPin1 = 3;
- const int ledPin2 = 5;
- const int ledPin3 = 6;
- const int ledPin4 = 9;
- const int ledPin5 = 10;
- const int ledPin6 = 11;
- int button1 = 1;
- int button2 = 2;
- int button3 = 4;
- int button4 = 8;
- int button5 = 16;
- int button6 = 32;
- int button7 = 64;
- int button8 = 128;
- int button9 = 256;
- int cim;
- // the setup routine runs once when you press reset:
- void setup() {
- // Enable DMX slave interface and start recording
- // DMX data
- dmx_slave.enable ();
- pinMode (button1, INPUT);
- pinMode (button3, INPUT);
- pinMode (button3, INPUT);
- pinMode (button4, INPUT);
- pinMode (button5, INPUT);
- pinMode (button6, INPUT);
- pinMode (button7, INPUT);
- pinMode (button8, INPUT);
- pinMode (button9, INPUT);
- // Set start address to 1, this is also the default setting
- // You can change this address at any time during the program
- dmx_slave.setStartAddress (1);
- // Set led pin as output pin
- pinMode ( ledPin1, OUTPUT );
- pinMode ( ledPin2, OUTPUT );
- pinMode ( ledPin3, OUTPUT );
- pinMode ( ledPin4, OUTPUT );
- pinMode ( ledPin5, OUTPUT );
- pinMode ( ledPin6, OUTPUT );
- }
- // the loop routine runs over and over again forever:
- void loop()
- {
- analogWrite ( ledPin1,( dmx_slave.getChannelValue (1)));
- analogWrite ( ledPin2,( dmx_slave.getChannelValue (2)));
- analogWrite ( ledPin3,( dmx_slave.getChannelValue (3)));
- analogWrite ( ledPin4,( dmx_slave.getChannelValue (4)));
- analogWrite ( ledPin5,( dmx_slave.getChannelValue (5)));
- analogWrite ( ledPin6,( dmx_slave.getChannelValue (6)));
- }
Add Comment
Please, Sign In to add comment