ESP32-WROVER-KIT-LCD-DRIVER/main/Example_Main.c

45 lines
1.0 KiB
C
Raw Permalink Normal View History

2020-11-03 15:32:38 +01:00
/* SPI Master example
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "esp_system.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "LCD.h"
2020-11-03 23:53:19 +01:00
/**
* @fn void app_main(void)
* @brief main task
* @param void
* @return void
* @author Hendrik Schutter
* @date 3.11.2020
*/
2020-11-03 15:32:38 +01:00
void app_main(void)
{
printf("Hello World!\n");
2020-11-04 22:28:24 +01:00
iLCD_init(); //init lcd screen
2020-11-03 23:53:19 +01:00
2020-11-04 22:28:24 +01:00
iLCD_clearFramebuffer(COLOR_BLACK); //set complete screen to desired color
2020-11-03 23:53:19 +01:00
2020-11-04 22:28:24 +01:00
vTaskDelay(1000 / portTICK_RATE_MS); //wait one sec
2020-11-03 23:53:19 +01:00
2020-11-04 22:28:24 +01:00
iLCD_writeString(42,42,"Hello World!",COLOR_WHITE,COLOR_BLACK); //Write text to screen
2020-11-03 23:53:19 +01:00
2020-11-04 22:28:24 +01:00
iLCD_writeString(42,50,"ESP32",COLOR_WHITE,COLOR_GREEN); //Write text to screen
2020-11-03 23:53:19 +01:00
2020-11-04 22:28:24 +01:00
while(1) {
//run more code here
2020-11-03 15:32:38 +01:00
}
2020-11-03 23:53:19 +01:00
2020-11-03 15:32:38 +01:00
}