Skip to content

Instantly share code, notes, and snippets.

@agrif
Last active September 15, 2025 17:15
Show Gist options
  • Select an option

  • Save agrif/6f96c4f90369525aa2e416131b92a502 to your computer and use it in GitHub Desktop.

Select an option

Save agrif/6f96c4f90369525aa2e416131b92a502 to your computer and use it in GitHub Desktop.
void main(void) {
//uart->divisor = 234;
*leds = 0x0;
#define SLOTS 6
uint8_t times[SLOTS] = {0};
uint8_t subtime = 0;
while (true) {
*leds = 0;
for (uint8_t i = 0; i < SLOTS; i++) {
*leds <<= 1;
if (subtime < sine_table[times[i]]) {
*leds |= 1;
}
}
subtime++;
if (subtime == 0) {
for (uint8_t i = 0; i < SLOTS; i++) {
times[i] += i * i + 1;
}
}
delay(100);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment