DLLs in certain folders are automatically
loaded when the program starts, and to
have duplicates — even if you have changed
the name — can create conflicts. By
changing the extension (I use .DXX), the old
file will be ignored by Vixen and there won’t
be any problems.
Figure 1 is the Vixen 2.1.x.x interface
with the data for a very simple eight-channel
sequence. For testing shows on our
hardware, we will use the generic serial
output driver and pump that right into the
Propeller’s programming port. You can get
to this driver by clicking on the Attached
Plugins toolbar button. This will cause the
display of the dialog box in Figure 2. When
we first create a sequence, there will be no
attached plug-ins. Find Generic serial in the Available
Plugins list, click on it, and then click the Use button. Now,
click on it in the Plugins In Use list, set the channels used,
and then click on Plugin Setup to set the COM port and
baud rate. I use 115.2K baud. The serial dialog box allows
for text headers and footers — leave these blank (see
Figure 3). If you spend about an hour with the tool
buttons, you can master creating sequences with Vixen.
For my use, I like to set the visual display to look like
ramps instead of density graphs, and I prefer to display
values as values (0 to 255) instead of percents (0 to 100).
Play. Yes, I said play. Drag-select a group of cells and click
the ramp on or ramp off. See how easy that was? There
are separate buttons for partial ramps and for lighting
effects like randomizing, sparkling, and shimmering.
Let’s look at the output on a Propeller board, shall
we? I have a version of code that will run on a QuickStart
board (available at your corner RadioShack), a demo
board, or on any other board that you can connect eight
LEDs to (use P16..P23 for the LED outputs). The serial
connection from Vixen to the Propeller will be through the
Propeller’s programming port.
The code on the Propeller side is very easy. We’ll load
up a serial object and a PWM controller for LEDs (I
covered that last year), and at the core, have this code:
■ FIGURE 2.
until (level => 0)
repeat ch from 1 to CHANNELS-1
level := serial.rxtime(1)
Yeah, that’s it, as long as the target output is a set of
LEDs (more on this later). At the top, we start the serial
and PWM objects, allow things to settle, clear any trash
from the serial input buffer, and then drop into the main
loop. Inside the big loop are three smaller loops. The first
waits until the serial line is idle for at least three
milliseconds; this is the shortest allowable gap between
channel packets. I borrowed this strategy from the
MODBUS RTU communications protocol: Frames are
transmitted as a contiguous group with the space between
frames used for synchronization.
The second loop waits until the first channel byte
pub main | level, ch
serial.start(RX1, TX1, %0000, BAUD)
level := serial.rxtime(3)
until (level < 0)
level := serial.rxcheck
■ FIGURE 3.
September 2012 59