Skip to content

Instantly share code, notes, and snippets.

@insom
Created March 1, 2021 03:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save insom/0e091bdb65e5abbd2fba68f8e7bebbd5 to your computer and use it in GitHub Desktop.
Save insom/0e091bdb65e5abbd2fba68f8e7bebbd5 to your computer and use it in GitHub Desktop.
Quick and Dirty Pi 256x256 Raster Display using a TLC7528CN DAC
#include <stdio.h>
#include "pico/stdlib.h"
#include "hardware/gpio.h"
#include "test.h"
#define FIRST_GPIO 0
char frame[256][256] = {0};
int main() {
for(int i = 0; i < 65536; i++) {
char *target;
target = frame;
target[i] = header_data[i];
}
for (int gpio = FIRST_GPIO; gpio < FIRST_GPIO + 17; gpio++) {
gpio_init(gpio);
gpio_set_dir(gpio, GPIO_OUT);
}
int32_t val = 0;
char x, y;
while (true) {
val++;
val = val & 0xffff;
x = val & 0xff;
y = val >> 8;
if(frame[255-x][y] == 0) {
gpio_put_all(val | 0x10000);
} else {
gpio_put_all(val);
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment