Hardware Reference
In-Depth Information
Figure 3-1:
The relationship
between bits
and bytes.
Designing the Sequencer
Now that you have all the elements in place you can begin to think about how you want this
to look and operate. This is called top-down design because you start with a top-level view of
what you want the software to look like.
I envisaged a grid of squares, each one representing an LED and its position in the sequence.
A column of eight squares would represent the states of the LEDs at any instance in the
sequence. A marker under the column will indicate what LEDs are being lit at any time. A
mouse click in one of these squares will toggle the LED.
In order to help set up the sequence there should be some control buttons, one to clear or turn
off all the LEDs in all sequence positions, and another to toggle or invert all the LEDs. There
should be control buttons to determine the speed of the sequence and finally one to select
where to take the trigger to advance the sequence from. This last point is important if you want
to synchronise the changing of the lights to the beat of the music. The sequence can either be
stepped at a regular rate determined by the speed controls, or locked into the beat of the music.
This last feature will require a little bit of extra hardware and is optional - you can skip it for
now and add it later if you like.
Finally it would be good if all the colours used in the sequence software were customizable;
that is, it should be easy to change by changing a single value at one point of the code only.
This means that whenever you use a colour you do not hard code it in by putting the colour
numbers into a function call, but rather use a variable to define that colour. Those variables
for all the colours should be grouped in one place in the code for easy access.
Search WWH ::




Custom Search