Created
March 1, 2021 03:51
-
-
Save insom/0e091bdb65e5abbd2fba68f8e7bebbd5 to your computer and use it in GitHub Desktop.
Quick and Dirty Pi 256x256 Raster Display using a TLC7528CN DAC
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 <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