The PC sends chr(255) chr(chipID) chr(brightness1)... chr(brightness16)
When a 255 arrives the recpos is set to 16. That means it has to wait for an address. If the address matches the chips address then recpos is set to 0 which means 16 bytes are about to come in. It then counts up to 15 as they arrive. Once at 15 it should stop and wait.
If pauses can cause problem then that could be it. I only check for data once every half cycle. Should i check more often? I can check upto 100 times every half cycle. For testing its set to 10 incase you were wondering


Ive only got 1 output working at the moment though. Ive got to put a loop in to handle all outputs and ive got to put the set address code back in but as it is the attached code is working perfectly.

Bookmarks