Created
September 18, 2024 21:03
-
-
Save agrif/6d60c20ef5b33118ef112f060ab5566a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#include <stdlib.h> | |
volatile uint32_t* LEDS = 0x10000; | |
extern void busy_loop(void); | |
#define DATA_AMOUNT 128 | |
uint8_t big_honking_data[DATA_AMOUNT] = {0}; | |
void main(void) { | |
uint8_t x = 1; | |
for (size_t i = 0; i < DATA_AMOUNT; i++) { | |
big_honking_data[i] = x; | |
x <<= 1; | |
if (x == 0) { | |
x = 1; | |
} | |
} | |
while (1) { | |
for (size_t i = 0; i < DATA_AMOUNT; i++) { | |
*LEDS = big_honking_data[i]; | |
busy_loop(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment