Components and supplies
Hitachi 16 * 2 LCD Display Shield
Arduino UNO
Conceptinetics DMX Shield
Screw Terminal Shield (pair)
Tools and machines
Cable, DMX 5F/3M XLR, Shielded
MA Lighting 2 port Node
Cable, DMX 5M/3F XLR, Shielded
MA Lighting GMA1 onPC Software
Apps and platforms
Conceptinetics.h DMX library
MA Lighting onPC Software
Project description
Code
DMXino 3.0
arduino
DMX Handheld Tester
1/* 2 ******************************************************************************* 3 DMXino DMX512 Transmitter / Reciever 4 ***************************************************************************** */ 5 6// set Variables used throughout program: 7 8const int ledPin = 13; //non dim indicator of current channel status 9 10// Variables that will change: 11 12int dimmer_val; //Value to be output in Transmit Mode 13int CHNumber = 1; //channel number in either mode 14float ChannelValuePER; //recieved channel value percent 15int ChannelValuePERint; //recieved channel value percent integer 16int TesterMode = 1; // Mode Flag (Transmit/Recieve)` 17 18#include <LiquidCrystal.h> 19 20// Select the pin used on LCD 21 22LiquidCrystal lcd(8, 9, 4, 5, 6, 7); 23 24// define the buttons; 25 26int lcd_key = 0; 27int adc_key_in = 0; 28#define btnRIGHT 0 29#define btnUP 1 30#define btnDOWN 2 31#define btnLEFT 3 32#define btnSELECT 4 33#define btnNONE 5 34 35//read the button value 36int read_LCD_buttons() 37{ 38 adc_key_in = analogRead(0); // read analog A0 value 39 // when read the 5 key values in the vicinity of the following0,144,329,504,741 40 // By setting different threshold, you can read the one button 41 42 if (adc_key_in < 50) return btnRIGHT; 43 if (adc_key_in < 250) return btnUP; 44 if (adc_key_in < 450) return btnDOWN; 45 if (adc_key_in < 650) return btnLEFT; 46 if (adc_key_in < 850) return btnSELECT; 47 return btnNONE; 48} 49#include <Conceptinetics.h> 50 51// 52// CTC-DRA-13-1 ISOLATED DMX-RDM SHIELD JUMPER INSTRUCTIONS 53// 54// If you are using the above mentioned shield you should 55// place the RXEN jumper towards G (Ground), This will turn 56// the shield into read mode without using up an IO pin 57// 58// The !EN Jumper should be either placed in the G (GROUND) 59// position to enable the shield circuitry 60// OR 61// if one of the pins is selected the selected pin should be 62// set to OUTPUT mode and set to LOGIC LOW in order for the 63// shield to work 64// 65 66// 67// 68// 69#define DMX_SLAVE_CHANNELS 512 70#define DMX_MASTER_CHANNELS 512 71// 72#define RXEN_PIN 2 73 74//DMX_Slave dmx_slave ( DMX_SLAVE_CHANNELS ); 75// If you are using an IO pin to control the shields RXEN 76// the use the following line instead 77DMX_Slave dmx_slave ( DMX_SLAVE_CHANNELS , RXEN_PIN ); 78 79// Configure a DMX master controller, the master controller 80// will use the RXEN_PIN to control its write operation 81// on the bus 82DMX_Master dmx_master ( DMX_MASTER_CHANNELS, RXEN_PIN ); 83 84 85 86 87void setup() 88{ 89 // initialize the LED pin as an output: 90 pinMode(ledPin, OUTPUT); 91 92 // Enable DMX slave interface and start recording 93 // DMX data 94 95 96 // Set start address, this is also the default setting 97 // You can change this address at any time during the program 98 dmx_slave.setStartAddress (CHNumber); 99 dmx_master.setChannelRange ( 1, 512, 00 ); 100 101 lcd.begin(16, 2); //This routine initializes the display, 102 lcd.setCursor(0, 0); // 103 lcd.print("DMXino TESTER"); 104 lcd.setCursor(0, 1); 105 lcd.print("DMX512"); 106 delay(1000); 107 // scroll 16 positions (string length) to the left 108 // to move it offscreen left: 109 for (int positionCounter = 0; positionCounter < 16; positionCounter++) { 110 // scroll one position left: 111 lcd.scrollDisplayRight(); 112 // wait a bit: 113 delay(30); 114 115 } 116 lcd.begin(16, 2); //Start in recieve mode 117 RecieveMode(); 118} 119 120 121void loop() 122{ 123 124 if (TesterMode == 1) 125 { 126 RecieveMode(); 127 } 128 if (TesterMode == 0) 129 { 130 TransmitMode(); 131 } 132 // ************LCD BUTTON INPUT************ 133 134 135 lcd_key = read_LCD_buttons(); // read key 136 137 switch (lcd_key) // display key 138 { 139 case btnRIGHT: 140 { 141 lcd.setCursor(13, 1); 142 lcd.print(" " ); 143 dimmer_val++; 144 delay (200); 145 break; 146 } 147 case btnLEFT: 148 { 149 lcd.setCursor(13, 1); 150 lcd.print(" " ); 151 dimmer_val--; 152 delay (200); 153 break; 154 } 155 case btnUP: 156 { 157 if (CHNumber < 512) 158 { 159 lcd.setCursor(5, 1); 160 lcd.print(" " ); 161 CHNumber++; 162 } 163 delay (200); 164 break; 165 } 166 case btnDOWN: 167 { 168 if (CHNumber > 1) 169 { 170 lcd.setCursor(5, 1); 171 lcd.print(" " ); 172 CHNumber--; 173 } 174 delay (200); 175 break; 176 } 177 178 case btnSELECT: 179 { 180 lcd.begin(16, 2); 181 lcd.setCursor(0, 0); 182 lcd.print(" TESTER MODE"); 183 delay (200); 184 TesterMode = !TesterMode; 185 186 break; 187 } 188 case btnNONE: 189 { 190 lcd.print(" "); 191 break; 192 } 193 194 } 195 // EXAMPLE DESCRIPTION 196 // 197 // If the selected channel comes above 50% the led will switch on 198 // and below 50% the led will be turned off 199 200 // NOTE: 201 // getChannelValue is relative to the configured startaddress 202 if ( dmx_slave.getChannelValue (CHNumber) > 127 ) 203 digitalWrite ( ledPin, HIGH ); 204 else 205 digitalWrite ( ledPin, LOW ); 206} 207 208void RecieveMode() 209{ 210 dmx_slave.enable (); 211 lcd.setCursor(0, 0); 212 lcd.print("DMXino Recieve"); 213 lcd.setCursor(0, 1); 214 lcd.print("CHAN#"); 215 lcd.setCursor(9, 1); 216 lcd.print("LVL"); 217 lcd.setCursor(5, 1); 218 lcd.print(CHNumber ); 219 lcd.setCursor(13, 1); 220 //lcd.print ( dmx_slave.getChannelValue(CHNumber)); 221 ChannelValuePER = dmx_slave.getChannelValue(CHNumber) / 2.55; 222 ChannelValuePERint = int( ChannelValuePER); 223 lcd.print (ChannelValuePERint); 224 225} 226 227void TransmitMode() 228{ 229 dmx_master.enable (); 230 lcd.setCursor(0, 0); 231 lcd.print("DMXino Transmit"); 232 lcd.setCursor(0, 1); 233 lcd.print("CHAN#"); 234 lcd.setCursor(9, 1); 235 lcd.print("LVL"); 236 237 lcd.setCursor(5, 1); 238 lcd.print(CHNumber ); 239 lcd.setCursor(13, 1); 240 lcd.print(dimmer_val); 241 dmx_master.setChannelValue ( (CHNumber), dimmer_val ); 242} 243 244
DMXino 3.0
arduino
DMX Handheld Tester
1/* 2 ******************************************************************************* 3 4 DMXino DMX512 Transmitter / Reciever 5 ***************************************************************************** 6 */ 7 8// set Variables used throughout program: 9 10const int ledPin = 13; 11 //non dim indicator of current channel status 12 13// Variables that will change: 14 15int 16 dimmer_val; //Value to be output in Transmit Mode 17int CHNumber = 1; //channel 18 number in either mode 19float ChannelValuePER; //recieved channel value percent 20int 21 ChannelValuePERint; //recieved channel value percent integer 22int TesterMode = 23 1; // Mode Flag (Transmit/Recieve)` 24 25#include <LiquidCrystal.h> 26 27// 28 Select the pin used on LCD 29 30LiquidCrystal lcd(8, 9, 4, 5, 6, 7); 31 32// 33 define the buttons; 34 35int lcd_key = 0; 36int adc_key_in = 0; 37#define 38 btnRIGHT 0 39#define btnUP 1 40#define btnDOWN 2 41#define btnLEFT 3 42#define 43 btnSELECT 4 44#define btnNONE 5 45 46//read the button value 47int read_LCD_buttons() 48{ 49 50 adc_key_in = analogRead(0); // read analog A0 value 51 // when read 52 the 5 key values in the vicinity of the following0,144,329,504,741 53 // By setting 54 different threshold, you can read the one button 55 56 if (adc_key_in < 50) return 57 btnRIGHT; 58 if (adc_key_in < 250) return btnUP; 59 if (adc_key_in < 450) return 60 btnDOWN; 61 if (adc_key_in < 650) return btnLEFT; 62 if (adc_key_in < 850) 63 return btnSELECT; 64 return btnNONE; 65} 66#include <Conceptinetics.h> 67 68// 69// 70 CTC-DRA-13-1 ISOLATED DMX-RDM SHIELD JUMPER INSTRUCTIONS 71// 72// If you are 73 using the above mentioned shield you should 74// place the RXEN jumper towards 75 G (Ground), This will turn 76// the shield into read mode without using up an IO 77 pin 78// 79// The !EN Jumper should be either placed in the G (GROUND) 80// position 81 to enable the shield circuitry 82// OR 83// if one of the pins is selected the 84 selected pin should be 85// set to OUTPUT mode and set to LOGIC LOW in order for 86 the 87// shield to work 88// 89 90// 91// 92// 93#define DMX_SLAVE_CHANNELS 94 512 95#define DMX_MASTER_CHANNELS 512 96// 97#define RXEN_PIN 2 98 99//DMX_Slave 100 dmx_slave ( DMX_SLAVE_CHANNELS ); 101// If you are using an IO pin to control the 102 shields RXEN 103// the use the following line instead 104DMX_Slave dmx_slave ( DMX_SLAVE_CHANNELS 105 , RXEN_PIN ); 106 107// Configure a DMX master controller, the master controller 108// 109 will use the RXEN_PIN to control its write operation 110// on the bus 111DMX_Master 112 dmx_master ( DMX_MASTER_CHANNELS, RXEN_PIN ); 113 114 115 116 117void setup() 118{ 119 120 // initialize the LED pin as an output: 121 pinMode(ledPin, OUTPUT); 122 123 124 // Enable DMX slave interface and start recording 125 // DMX data 126 127 128 129 // Set start address, this is also the default setting 130 // You can change 131 this address at any time during the program 132 dmx_slave.setStartAddress (CHNumber); 133 134 dmx_master.setChannelRange ( 1, 512, 00 ); 135 136 lcd.begin(16, 2); //This 137 routine initializes the display, 138 lcd.setCursor(0, 0); // 139 lcd.print("DMXino 140 TESTER"); 141 lcd.setCursor(0, 1); 142 lcd.print("DMX512"); 143 delay(1000); 144 145 // scroll 16 positions (string length) to the left 146 // to move it offscreen 147 left: 148 for (int positionCounter = 0; positionCounter < 16; positionCounter++) 149 { 150 // scroll one position left: 151 lcd.scrollDisplayRight(); 152 // 153 wait a bit: 154 delay(30); 155 156 } 157 lcd.begin(16, 2); //Start in recieve 158 mode 159 RecieveMode(); 160} 161 162 163void loop() 164{ 165 166 if (TesterMode 167 == 1) 168 { 169 RecieveMode(); 170 } 171 if (TesterMode == 0) 172 { 173 TransmitMode(); 174 175 } 176 // ************LCD BUTTON INPUT************ 177 178 179 lcd_key = read_LCD_buttons(); 180 // read key 181 182 switch (lcd_key) // display key 183 { 184 185 case btnRIGHT: 186 { 187 lcd.setCursor(13, 1); 188 lcd.print(" 189 " ); 190 dimmer_val++; 191 delay (200); 192 break; 193 194 } 195 case btnLEFT: 196 { 197 lcd.setCursor(13, 1); 198 lcd.print(" 199 " ); 200 dimmer_val--; 201 delay (200); 202 break; 203 204 } 205 case btnUP: 206 { 207 if (CHNumber < 512) 208 { 209 210 lcd.setCursor(5, 1); 211 lcd.print(" " ); 212 CHNumber++; 213 214 } 215 delay (200); 216 break; 217 } 218 case btnDOWN: 219 220 { 221 if (CHNumber > 1) 222 { 223 lcd.setCursor(5, 224 1); 225 lcd.print(" " ); 226 CHNumber--; 227 } 228 229 delay (200); 230 break; 231 } 232 233 case btnSELECT: 234 235 { 236 lcd.begin(16, 2); 237 lcd.setCursor(0, 0); 238 lcd.print(" 239 TESTER MODE"); 240 delay (200); 241 TesterMode = !TesterMode; 242 243 244 break; 245 } 246 case btnNONE: 247 { 248 lcd.print(" 249 "); 250 break; 251 } 252 253 } 254 // EXAMPLE DESCRIPTION 255 256 // 257 // If the selected channel comes above 50% the led will switch on 258 259 // and below 50% the led will be turned off 260 261 // NOTE: 262 // getChannelValue 263 is relative to the configured startaddress 264 if ( dmx_slave.getChannelValue (CHNumber) 265 > 127 ) 266 digitalWrite ( ledPin, HIGH ); 267 else 268 digitalWrite ( ledPin, 269 LOW ); 270} 271 272void RecieveMode() 273{ 274 dmx_slave.enable (); 275 lcd.setCursor(0, 276 0); 277 lcd.print("DMXino Recieve"); 278 lcd.setCursor(0, 1); 279 lcd.print("CHAN#"); 280 281 lcd.setCursor(9, 1); 282 lcd.print("LVL"); 283 lcd.setCursor(5, 1); 284 lcd.print(CHNumber 285 ); 286 lcd.setCursor(13, 1); 287 //lcd.print ( dmx_slave.getChannelValue(CHNumber)); 288 289 ChannelValuePER = dmx_slave.getChannelValue(CHNumber) / 2.55; 290 ChannelValuePERint 291 = int( ChannelValuePER); 292 lcd.print (ChannelValuePERint); 293 294} 295 296void 297 TransmitMode() 298{ 299 dmx_master.enable (); 300 lcd.setCursor(0, 0); 301 lcd.print("DMXino 302 Transmit"); 303 lcd.setCursor(0, 1); 304 lcd.print("CHAN#"); 305 lcd.setCursor(9, 306 1); 307 lcd.print("LVL"); 308 309 lcd.setCursor(5, 1); 310 lcd.print(CHNumber 311 ); 312 lcd.setCursor(13, 1); 313 lcd.print(dimmer_val); 314 dmx_master.setChannelValue 315 ( (CHNumber), dimmer_val ); 316} 317 318
Downloadable files
DMXino V4
DMXino V4
Comments
Only logged in users can leave comments
KevinMcArthur
0 Followers
•0 Projects
Table of contents
Intro
4
0