Hi all,
I have been presented with an issue at a venue I look after. The venue in question has an "Alcorn McBride LightCue" dmx playback unit that is linked to their front of house event automation system.
I have taken on the task of building a controller with a simple front end that triggers 16 individual cues within the light cue controller.
The Alcorn McBride LightCue controller has a 'close-contact' feature that will allow triggering of any one of the internal 16 cues by the way of matrixing the unit's 4 close contact inputs.
I have designed a box with 20 buttons on the front and a 16x2 LED screen.
buttons 1-16 is quite simply a "cue select" button, of which the screen will show "Cue 1 - Audience Lights", etc. To execute a cue, the light cue controller then looks for a close contact on 2 of it's pins, again, over the parallel port. In total, 8 x relays are needed.
The Manual for the unit is here: http://www.alcorn.com/library/manuals/man_lcue.pdf
Essentially, I have some Arduino knowledge but I have been going around in circles all day. I have an Arduino Mega earmarked for this based on the amount of I/O available.
I have assumed (no matrixing on the switches to keep it simple) that the 20 momentary push switches will be take up 20 pins, 8 pins for the relays and once the switch system is working, I will use the 74HC595 to multiplex the LED's in the switches (illuminated switches). FYI, the 20 switches are 1-16 cue select, 17 -play cue, 18 - loop cue, 19 - pause cue, 20, stop cue.
As it stands, I assume that I will want a sketch that, in its loop, will look for button presses and then trigger a procedure.
Assuming I am on the right track, if button 1 (call it Lighting Cue 1) is pressed, I would want this to happen:
1: Arduino is waiting for button push...."READY for CUE" on the screen
2: Button 1 (LX cue 1) is pushed (relays latch in the box (that are connected to other pins on the arduino) thus shorting pins that refer to cue 1 on the light cue controller).
3: Arduino screen reports "Cue 1 selected"
4: "Play" button pushed (cue 1 LX relays still latched. Play button then latches the "Play" relay (which shorts the relevant pins on the light cue controller).
5: After a second or so, the Arduino reverts back to it's loop, waiting for the next button push.
Note: I would like the led in the relevant button to light up when it's pushed.
I know this is quite a project but I am keen to learn how to do it.
If all falls to pieces I will pay a programmer to do it!
Any input would be most appreciated!
For your amusement, below is what I knocked up today..that is useless!
int buttonPLAY = A5; // Play
int buttonPAUSE= 23; // Pause
int buttonLOOP = 24; // Loop
int buttonSTOP = 25; // Stop
int button1 = 12; // Cue 1
int button2 = 27; // Cue 2
int button3 = 28; // Cue 3
int button4 = 29; // Cue 4
int button5 = 30; // the number of the pushbutton pin
int button6 = 31; // the number of the pushbutton pin
int button7 = 32; // the number of the pushbutton pin
int button8 = 33; // the number of the pushbutton pin
int button9 = 34; // the number of the pushbutton pin
int button10 = 35; // the number of the pushbutton pin
int button11 = 36; // the number of the pushbutton pin
int button12 = 37; // the number of the pushbutton pin
int button13 = 38; // the number of the pushbutton pin
int button14 = 39; // the number of the pushbutton pin
int button15 = 40; // the number of the pushbutton pin
int button16 = 41; // the number of the pushbutton pin
int RelayPLAY = 5;
int RelayPAUSE = 43;
int RelayLOOP = 44;
int RelaySTOP = 45;
int Relay1 = 46; //PLAY RELAY
int Relay2 = 47; //PAUSE RELAY
int Relay3 = 48; //LOOP RELAY
int Relay4 = 49; //STOP RELAY
int Relay5 = 18;
int Relay6 = 19;
int Relay7 = 20;
int Relay8 = 21;
int led1 = 3;
int led2 = 4;
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
Serial.begin(9600);
pinMode(RelayPLAY, OUTPUT); //relays as outputs
pinMode(RelayPAUSE, OUTPUT);
pinMode(RelayLOOP, OUTPUT);
pinMode(RelaySTOP, OUTPUT);
pinMode(Relay5, OUTPUT);
pinMode(Relay6, OUTPUT);
pinMode(Relay7, OUTPUT);
pinMode(Relay8, OUTPUT);
pinMode(buttonPLAY, INPUT); //Button as inputs
pinMode(buttonPAUSE, INPUT);
pinMode(buttonLOOP, INPUT);
pinMode(buttonSTOP, INPUT);
pinMode(button1, INPUT);
pinMode(button2, INPUT);
pinMode(button3, INPUT);
pinMode(button4, INPUT);
pinMode(button5, INPUT);
pinMode(button6, INPUT);
pinMode(button7, INPUT);
pinMode(button8, INPUT);
pinMode(button9, INPUT);
pinMode(button10, INPUT);
pinMode(button11, INPUT);
pinMode(button12, INPUT);
pinMode(button13, INPUT);
pinMode(button14, INPUT);
pinMode(button15, INPUT);
pinMode(button16, INPUT);
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(RelayPLAY, LOW);
pinMode(buttonPLAY, LOW);
}
void loop(){
digitalWrite(led2, HIGH);//test LED
buttonState = digitalRead(button1);
if (buttonState == HIGH)
CUE1(); //go to CUE1 Function
/***/
buttonState = analogRead(buttonPLAY);
if (buttonState == HIGH)
PLAY();} //go to PLAY function
/**************************************************/
void PLAY(){
buttonState = digitalRead(buttonPLAY);
if (buttonState == LOW); {
digitalWrite(RelayPLAY, HIGH);}
Serial.println("Playing...");}
/************************************************/
void CUE1(){
buttonState = analogRead(button1);
if (buttonState == HIGH) {
digitalWrite(led1, HIGH);
Serial.println("CUE 1 - Playing");}
else {
loop;}}
I really appreciate your thoughts/input on this.
Thanks
Duncan