Skip to content

Instantly share code, notes, and snippets.

@agrif
Created September 18, 2024 21:03
Show Gist options
  • Save agrif/6d60c20ef5b33118ef112f060ab5566a to your computer and use it in GitHub Desktop.
Save agrif/6d60c20ef5b33118ef112f060ab5566a to your computer and use it in GitHub Desktop.
#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