Pd --> Firmata --> Arduino --> DMX

Does anyone here have experience with sending messages with Firmata from Pure Data to an Arduino to control DMX lights?

I have a DMX lamp with which I've broken out the XLR cables. Red is going to pin 3, white to pin 4 and the copper braid into the ground of an Arduino Duemilanove.

There few approaches to this, none of which are working for me. I've looked into the DmxSimple library from Tinker.It, as well as all the Firmata sketches. It seems that what I'm after is a bit of a mix between the StandardFirmata sketch which I think interfaces with Pd, and the DmxSimple sketches which interpret code from Arduino for the lamp. As I have no idea how to code in C, I'm a bit stumped!

I would have thought the messages from Pure Data should look something like [digital 1 255( which would turn channel 1 (red) up to full, but it's not working.

Any help would be greatly appreciated!

I'm running Pd 0.41.4-extended on MacBook Pro running OS X 10.6.4.

Here’s the link to the DmxSimple library.

DmxSimple: http://code.google.com/p/tinkerit/wiki/DmxSimple

Hi all,

Just in case this interests anyone, I've now solved this problem and have made a video tutorial on how to do hook this up, along with a few examples of usage possibilities.

Pt 1: http://www.youtube.com/watch?v=3Q4hLA7YM7c Pt 2: http://www.youtube.com/watch?v=sq33uOGq_l0

Let me know of any questions!

Using the DmxSimple library, skpang DMX shield and an Arduino Duemilanova, I got things working nicely from Pd via Firmata using this firmware:

#include <Firmata.h>
#include <DmxSimple.h>

void dmxWriteCallback(byte pin, int value)
{
    DmxSimple.write(pin, value);
}

void setup()
{
    Firmata.setFirmwareVersion(0, 1);
    Firmata.attach(ANALOG_MESSAGE, dmxWriteCallback);
    Firmata.begin(57600);
    
    pinMode(2, OUTPUT); // pin 2 for skpang DMX Shield direction pin
    digitalWrite(2, HIGH);  // Set direction pin of transceiver to Tx.
  
    // Firmata only supports 16 analog pins, so limit the DMX output
    DmxSimple.maxChannel(16);
}

void loop()
{
    while(Firmata.available()) {
        Firmata.processInput();
    }
}