Hello all,
I'm working on a project that involves controlling a 15x character tricolour message board with the Arduino. I've come to the stage where I need a little help with the coding... If i'm honest I don't really understand the structure of how to set out the main loop and use binary/bit arrays correctly.
Hardware- 8x8 tricolour matrix (15x)
- The Rows are controlled by a HEF4028BP 1-10 4-bit Decoder that in turn signals an 8 channel source driver to power the LED's
- The Columns (cathode) are connected to an 8-bit serial Shift Register MIC5821BN
- Shift Registers are 'daisy chained' (data out -> data in) to connect each matrix from right to left across the message display board.
- One line of shift registers controls the columns for the Red LED's, the other line for Green LED's.
Switch on an LED/pixel1. The decoder must be set to the desired row using the correct combination - this is then set HIGH (anode)
2. Then set the shift register to control the columns - the column is set LOW (cathode) for the LED's to be active.
If an LED/pixel is not required, then it needs to be set HIGH so that it does not light.
3. For colour - if green is desired then all of red shift register needs to be all HIGH. For red, all green shift registers HIGH. For orange, both shift registers need to receive the same information on their data pin.
You can see how to control the decoder for the each row on the 'Truth Table' of the datasheet:
http://pdf1.alldatasheet.com/datasheet-pdf/view/17702/PHILIPS/HEF4028BP.htmlProject Objectives- Eventually, the sketch should be able to read a serial string message and display on the LED board.
- Sketch should allow users to enter parameters for the hardware setup such as the amount of columns/shift registers and other values that define the scrolling speed etc.
The serial string should contain key values that determine the displays function... for example:
Colours: [R] for Red / [G] for Green / [O] for Orange
Movement: [ST] for static entry of text, then scroll to view entire message. [SCR] scroll entry from the right of the display
Sample Message: "[G][SCR] Hello World" - this would display "Hello World" in green, scrolling entry from the right.
Stuff I really need to know...- As only one row can be active at one time, each row needs to be scanned rapidly in a loop to view 8x rows on the matrix. What's the best way of doing this without other functions interrupting the loop?
- What's the best way of creating a bit array for defining the characters. (perhaps use an array for the pins of the row decoder too?)
I'm a bit new here and realise this is a rather lengthy post...
I've attached an image and a simple sketch that loops through the matrix rows.
Hope someone can help?