just wanted to share a little video of a contraption we recently built for an event we held called The Kronos Returns here in Liverpool at the Kazimier. the theme of the event was to do with time travelling and so we needed a good space ship. the kronos was built out of wood and perspex and can open and close - on the night performers were lowered down out of it. The kronos has 64 ultra bright LED's and 8 x PAR 36 pin spots. All the LEDs were controlled through arduino using a MAX7219 multiplexing chip, with the pinspots being turned on and off using relays. The arduino was in turn controlled through midi allowing for the entire lighting show to be sequenced in ableton live. the kronos also had a projector mounted above it and the image came up really well on the white perspex. using ableton was great as it allowed for real time sequencing and manipulation over all the individual LEDs. I learnt quite a bit from doing this, mainly that trying to wire in that many LEDs is a lot of work! i am now building a larger system and will be using multicore flex with scsi style connectors, making the whole thing more modular. Also weirdly, if i turned on the external power supply for the LEDs before I turned on the arduino the midi would not work well. I guess this must be to do with the way i grounded everything. below is the code I used (thanks to Asa Calow for all the help):
#include <Sprite.h>
#include <Matrix.h>
#include <MIDI.h>
Matrix myMatrix = Matrix(6, 3, 2);
int i;
int midiNote;
int x;
int y;
int spotNumber;
int spotStartingPin = 8; // the first pin which controls a spot
int numberOfSpots = 8; // the total number of spots you want to control.
void setup() {
MIDI.begin();
myMatrix.clear();
for (i = spotStartingPin; i <= spotStartingPin+numberOfSpots-1; i++) {
pinMode(i, OUTPUT);
}
}
void loop() {
if (MIDI.read()) {
midiNote = MIDI.getData1();
// if the midiNote is 64 or under send it to the led driver
if (midiNote <= 64) {
convertMidiToCoordinates(midiNote);
switch (MIDI.getType()) {
case NoteOn:
myMatrix.write(x, y, HIGH);
break;
case NoteOff:
myMatrix.write(x, y, LOW);
break;
}
} else {
// if we're here the midi note is higher than 64 so send it to a spot
spotNumber = midiNote - 66 + spotStartingPin; // so midiNote 65 = spotStartingPin etc.
switch (MIDI.getType()) {
case NoteOn:
// switch on the spot
digitalWrite(spotNumber, HIGH);
break;
case NoteOff:
// switch off the spot
digitalWrite(spotNumber, LOW);
break;
}
}
}
}
void convertMidiToCoordinates(int midiNote) {
x = midiNote / 8;
y = midiNote % 8;
}