Learning project for NCUT2019 ESD students

Dependencies:   LCD_DISCO_F429ZI mbed mbed-rtos BSP_DISCO_F429ZI

main.cpp

Committer:
andrey001207
Date:
2019-05-11
Revision:
12:8679b4ebe162
Parent:
11:0309bef74ba8
Child:
13:4752ccf82972

File content as of revision 12:8679b4ebe162:

#include "mbed.h"
#include "rtos.h" 
#include "LCD_DISCO_F429ZI.h"

LCD_DISCO_F429ZI lcd;

DigitalOut led1(LED1);
DigitalOut led2(LED2);
Thread thread_led;
Thread thread_lcd;
 
void led2_thread() {
    while (true) {
        led2 = !led2;
        Thread::wait(1000);
    }
}

void lcd_thread() {
    while (true) {
        Thread::wait(500);
        lcd.DisplayStringAt(0, 35, (uint8_t *)"128228", CENTER_MODE);
        Thread::wait(500);
        lcd.DisplayStringAt(0, 35, (uint8_t *)"<NCUT>", CENTER_MODE);
    }
}
 
int main() {
    lcd.DisplayStringAt(0, 20, (uint8_t *)"Andrew", CENTER_MODE);
    thread_led.start(led2_thread);
    thread_lcd.start(lcd_thread);
    
    while (true) {
        led1 = !led1;
        Thread::wait(500);
    }
}