LPD6803 LED Pixel controlling software for Mini Maestro

I’m looking for some advice, hopefully about the PWM output, and synchronizing programs to it.

I’ve bought a strand of 50 RGB LED pixels. They’re individually addressable via LPD6803. Basically, aside from power, there’s 2 wires. One is the “clock”, and the other is the “data”. The clock serves 2 purposes - it’s used by the chips to handle PWM (for “dimming” the LEDs), and also used to synchronize the data inputs. As the data is sent (the other wire), each LED in turn (along the string) consumes it’s own 16bits of colour information. To set the colour of all 50 pixels, I need to send 16*50=800 bits.

Here’s some more info about it all: ladyada.net/products/pixel20mm/index.html

Question: I’m wandering if it’s possible to write a Maestro script that can use the PWM pin connected directly to the LPD6803’s clock wire, and if so, how I might be able to synchronize the sending of the data out to the second wire.

Assuming that is possible, my next question is about getting the colour data into the Maestro in order to send it - my plan is to provide it over the serial port - does anyone know what happens if the Maestro tries to read some serial data, but nothing is being sent? Does it wait forever?

Are there any expert programmers out there? What would be my best way of pulsing the clock wire continuously, while sending data simultaneously (and in sync) out the data wire, and at the end of an 800bit sending-session, being able to read in the next 800bits from the serial port (while still pulsing the clock wire of course).

In case you’re wondering - I want to make some “interesting” clothing, which illuminates programmatically, controlled by audio and accelerometer sensors.

P.S. Does anyone know the clock speed of the Maestro Script? And what about the number of cycles per command? Are they all the same?

Take the below, for example:-

begin
  led_on
  led_off
repeat

How long with the LED be on for, and how long will it be off? (yes, it’s a trick question; I’m expecting the “repeat” at least to take time)

Hello, cnd.

The Maestro doesn’t have any ability to synchronize the script with the PWM output, so I don’t think you should use the PWM output. I would attempt to control these LEDs the same way we control the shiftbrites in the User’s Guide, by just doing bit-banging on some Maestro channels configured as outputs. If the clock line really does control the brightness of the LEDs, then I would simply leave the clock line high after sending data to get the full brightness.

Please note that I haven’t looked carefully at the LED product so I can’t be sure the Maestro will work.

The Maestro scripting language does not have any command for directly reading serial data so I’m not sure what you’re asking about.

Unfortunately I don’t know of any great way of sending 800 bits to a Maestro script from a computer.

The Maestro script is running on the same processor that does everything else and running the script is one of the lowest priorities. The speed of your script will vary from line to line and it will depend on how the busy the Maestro is doing everything else.

I think you should consider getting a more powerful processor for this application. A Wixel or an Arduino should work nicely. You can communicate with either of them over USB as a virtual COM port, and write your own C program to do what you want.

–David