Close

Driving the LED´s

A project log for Project Battlesnakes

A classic game of snake, but with a twist and added hardware constraints.

phil-weaselPhil Weasel 09/03/2024 at 07:260 Comments

The LED´s are controlled row for row.
Every row is two bytes, one for RED, one for GREEN (= 16Led per row -> 16Bit)
So we have a screen buffer of (2*8Bit)*8Rows = 16Bytes

Displaying frame therefore consists of:
1. Combining RED and GREEN buffer of current row to a 16Bit integer
2. Sending the 16Bit via Data pin
3. Pulling LAT HIGH(driver will output last data received)
4. Pull PNP Transostor of corresponding row LOW
5. Wait for a ON-time
6. Pull NPN HIGH
7. Pull LAT LOW
8. Repeat for every row

Since this is happening so fast, the LED´s are in fact blinking, but since our eyes are so "slow" we see it as a constant on.

Discussions