Add meaningful colour struct, double buffering
This commit is contained in:
parent
bc062dac9b
commit
fff3b133c1
4 changed files with 93 additions and 15 deletions
17
src/main.c
17
src/main.c
|
|
@ -10,8 +10,25 @@ int main(void)
|
|||
|
||||
LED_Init();
|
||||
|
||||
int ct = 0;
|
||||
uint8_t *data = (uint8_t*)LED_PixelData;
|
||||
while(1)
|
||||
{
|
||||
if(LED_FrameFlag)
|
||||
{
|
||||
LED_FrameFlag = false;
|
||||
data[ct]++;
|
||||
LED_Commit();
|
||||
if(data[ct] == 255)
|
||||
{
|
||||
ct += 3;
|
||||
if(ct >= LED_COLUMNS * LED_ROWS)
|
||||
{
|
||||
ct -= LED_COLUMNS * LED_ROWS;
|
||||
ct += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue