Hi, I've allready made a dmx shield working.I've connected 4 led pars, who are programmed to listen from channel 1-16 for each par 4 channels. I have tested the DMXsimple library, but I want to know how to connect the shield to Modul8 or Qlab? I have the the shield connected to digital-in 1. How do I have to program the DMX shield to understand the Enttec USB PRO drivers to work in OSX?
and combined the ardumidi and dmx simple library like this:
/* Welcome to DmxSimple. This library allows you to control DMX stage and
** architectural lighting and visual effects easily from Arduino. DmxSimple
** is compatible with the Tinker.it! DMX shield and all known DIY Arduino
** DMX control circuits.
**
** DmxSimple is available from: http://code.google.com/p/tinkerit/
** Help and support: http://groups.google.com/group/dmxsimple */
/* To use DmxSimple, you will need the following line. Arduino will
** auto-insert it if you select Sketch > Import Library > DmxSimple. */
#include <DmxSimple.h>
#include <ardumidi.h>
int ledPin = 13;
int note_on = 0;
void setup() {
/* The most common pin for DMX output is pin 3, which DmxSimple
** uses by default. If you need to change that, do it here. */
DmxSimple.usePin(11);
Serial.begin(115200); // will change baud rate of MIDI traffic from 31250 to 115200
/* DMX devices typically need to receive a complete set of channels
** even if you only need to adjust the first channel. You can
** easily change the number of channels sent here. If you don't
** do this, DmxSimple will set the maximum channel number to the
** highest channel you DmxSimple.write() to. */
DmxSimple.maxChannel(256);
}
int value = 0;
int channel;
void loop() {
while (midi_message_available() > 0) {
// DmxSimple.write(3, 255);
MidiMessage m = read_midi_message();
int controlMax = 127;
int c = int(m.channel)+1;
int channel = m.channel+1;
int control = m.param1;
int controlSelect = m.param1;
if (channel == 1){ //
while ( (channel == 1) && (control == control) ) { // BLEND
int velocity = map(int(m.param2),0,127,0,255);
DmxSimple.write(control, velocity);
}
}
else if (channel == 2) {
while ( (channel == 2) && (control == control) ) { // BLEND
int velocity = map(int(m.param2),0,127,0,255);
DmxSimple.write(controlMax+control, velocity);
}
}
// reset all channels after use
if (channel == 3){
while ( (channel == 1) && (control == control) ) { // seperate
int velocity = map(int(m.param2),0,127,0,255);
DmxSimple.write(control, velocity);
reset(int(control));
}
}
else if (channel == 4) {
while ( (channel == 2) && (control == control) ) { // seperate
int velocity = map(int(m.param2),0,127,0,255);
DmxSimple.write(controlMax+control, velocity);
reset(int(controlMax+control));
}
}
// STOP ALL CHANNELS
if( (channel == 16) && (control == 1)){ // STOP
for(int i=0; i< 512; i++){
DmxSimple.write(i, 0);
}
}
}
}
void reset(int noChannel){
// STOP ALL CHANNELS
for(int i=0; i< 256; i++){
if (noChannel == i){
DmxSimple.write(i, 0);
}
}
}
For people, who don't like latency on the FTDI driver, look at this: