DmxSimple Library
DmxSimple, by Peter Knight, allows you to control up to 512 DMX lighting dimmers.
Download: |
Included with the Teensyduino Installer Latest Developments on Github |
DmxSimple only transmits. Ward's code can receive DMX on Teensy 3.0.
A serial-based DMX library for Teensy 3.x with Transmit & Receive is now available.
Another serial based DMX library is also now available with direct hardware access & optimized buffering.
This MIDI to DMX Instructable may also help, for efficient transmit-only code on Teensy LC, 3.2, 3.5 or 3.6.
Hardware Requirements
TODO: document connections, show photos - Andy confirms it works (Teensy++ only)... need to find someone local with a DMX dimmer pack so I can test and take a good photo.Basic Usage
DmxSimple.write(channel, brightness);Set the DMX channel (1 to 512) to brightness (0 to 255)
Example Program
/* 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> 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(3); /* 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(4); } void loop() { int brightness; /* Simple loop to ramp up brightness */ for (brightness = 0; brightness <= 255; brightness++) { /* Update DMX channel 1 to new brightness */ DmxSimple.write(1, brightness); /* Small delay to slow down the ramping */ delay(10); } }