76 lines
1.7 KiB
C
76 lines
1.7 KiB
C
#include <stdio.h>
|
|
#include "st7735.h"
|
|
#include <wiringPi.h>
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
setbuf(stdout, NULL);
|
|
|
|
wiringPiSetup();
|
|
|
|
lcd_t* lcd = lcd_init(40000000, 10, 2, 0);
|
|
|
|
printf("Fill display...");
|
|
printf("blue...");
|
|
lcd_fillScreen(0, 70, 160);
|
|
delay(1000);
|
|
printf("black...");
|
|
lcd_fillScreen(0, 0, 0);
|
|
printf("DONE\n");
|
|
delay(1000);
|
|
|
|
/* Draw the lines */
|
|
/*printf("Lines...");
|
|
lcdst_drawHLine(0, 149, 128, 0, 255, 255);
|
|
lcdst_drawHLine(0, 139, 128, 255, 255, 0);
|
|
lcdst_drawVLine(117, 0, 160, 0, 255, 255);
|
|
lcdst_drawVLine(107, 0, 160, 255, 255, 0);
|
|
printf("DONE\n");*/
|
|
|
|
/*printf("Points...");
|
|
for (int i = 1; i < 20; i++) {
|
|
lcdst_drawPx(5 - 1, 70 + i, 100, 100, 100);
|
|
lcdst_drawPx(5 + i + 1, 70 + i, 100, 100, 100);
|
|
}
|
|
printf("DONE\n");
|
|
|
|
printf("Triangle...");
|
|
for (int i = 1; i < 20; i++) {
|
|
lcdst_drawHLine(5, 70 + i, i, 255, 0, 0);
|
|
}
|
|
printf("DONE\n");*/
|
|
|
|
printf("Rectangles...");
|
|
//printf("outline...");
|
|
//lcd_drawRect(10, 10, 10, 10, 0, 255, 255);
|
|
//lcd_drawRect(10, 30, 10, 10, 255, 255, 0);
|
|
printf("filled...");
|
|
lcd_fillRect(30, 10, 10, 10, 0, 255, 255);
|
|
lcd_fillRect(30, 30, 10, 10, 255, 255, 0);
|
|
printf("bunch...");
|
|
for (int i = 0; i < 40; i++) {
|
|
lcd_fillRect(40 + (i%13) * 4, 40 + (i%19) * 4, 20, 20, i % 5 * 15, i % 7 * 17, i % 3 * 23);
|
|
}
|
|
printf("DONE\n");
|
|
|
|
printf("Text...");
|
|
lcd_printChar(10, 90, 'A');
|
|
lcd_printText(10, 50, "Ahoj!");
|
|
lcd_printChar(10, 100, 'Z');
|
|
printf("DONE\n");
|
|
|
|
/* Send the raw data */
|
|
/* printf("Raw...");
|
|
lcdst_setWindow(20, 20, 29, 29);
|
|
for(uint8 i=0; i<100; i++) lcdst_pushPx(255, 0, 255);
|
|
lcdst_setWindow(0, 0, 127, 159);
|
|
printf("DONE\n");*/
|
|
|
|
|
|
/* Uninitialize the display */
|
|
//lcd_deinit(lcd);
|
|
|
|
return 0;
|
|
}
|
|
|