Commit a43326c6 authored by Yongjia Niu's avatar Yongjia Niu
Browse files

Main: Print Some text on the LCD

parent 5ae21908
https://github.com/cypresssemiconductorco/emwin/#dd87764b00041bc3d901381b992f23ba18f4f1b2
#include "mbed.h"
#include "mbed_trace.h"
#include "GUI.h"
#include "NTPClient.h"
#include "IoTConnectCommon.h"
#include "IoTConnectClient.h"
......@@ -99,6 +100,30 @@ int sync_rtc_time(NetworkInterface* net, const char* ntp_server = NULL) {
return 0;
}
void lcd_init() {
int x = 0;
int y = 0;
GUI_Init();
// GUI_SetColor(GUI_WHITE);
GUI_SetColor(GUI_MAKE_COLOR(0x009E56));
GUI_SetBkColor(GUI_BLACK);
GUI_SetFont(GUI_FONT_32B_1);
GUI_SetTextAlign(GUI_TA_CENTER);
x = GUI_GetScreenSizeX() / 2;
y = GUI_GetScreenSizeY() / 2 - 16 - 10;
GUI_DispStringAt("Avnet IoTConnect", x, y);
GUI_SetFont(GUI_FONT_20B_1);
GUI_SetTextAlign(GUI_TA_CENTER);
y = y + 40;
GUI_DispStringAt("https://www.iotconnect.io/", x, y);
GUI_DrawRect(0, 0, GUI_GetScreenSizeX() - 1, GUI_GetScreenSizeY() - 1);
}
int main() {
int ret = 0;
cJSON *attr = NULL;
......@@ -111,6 +136,8 @@ int main() {
printf("Mbed OS version %d.%d.%d\n\n", MBED_MAJOR_VERSION, MBED_MINOR_VERSION, MBED_PATCH_VERSION);
#endif
lcd_init();
i2c.frequency(400000);
imu = new BMI160_I2C(i2c, BMI160_I2C::I2C_ADRS_SDO_LO);
......
https://github.com/iotexpert/mbed-os-emwin-st7789v/#965d04c7d54b7b6c813fbf308f7e9bf098521b44
......@@ -15,7 +15,8 @@
"mbed-trace.enable": 1,
"mbed-trace.max-level": "TRACE_LEVEL_DEBUG",
"mbed-mqtt.max-connections": "5",
"mbed-mqtt.max-packet-size": "2048"
"mbed-mqtt.max-packet-size": "2048",
"target.components_add": ["EMWIN_OSNTS"]
},
"CY8CKIT_062_WIFI_BT": {
"platform.stdio-baud-rate": 115200,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment