Multiplexing
Multiplex the rows of the matrix
The final task is to multiplex the rows of electrical matrix into a full image. We will be doing this by scanning through the rows in the display.
Pseudocode
In order to light up an LED, the row needs to be set high and the column needs to be set low. We will assume that at the start of a refresh cycle, that all the rows are set low and all the columns are set high. The order of operations during a refresh cycle is then, for each row:
- set the row high
- for each column
- set low if the LED associated with that row-column pair should be on
- sleep for a known duration, you should find 2ms is sufficient
- for each column
- set high
- set the row low