前一段时间,Mbed给出了Disco-F769NI的液晶例程,但是并不能正常显示。今天再次尝试了一下,发现可以正常显示了,就是还不正常触屏。
- #include "mbed.h"
- #include "LCD_DISCO_F769NI.h"
- LCD_DISCO_F769NI lcd;
- DigitalOut led_red(LED1);
- DigitalOut led_green(LED2);
- uint32_t width, height;
- int main()
- {
- led_green = 0;
- led_red = 1;
- lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"MBED EXAMPLE", CENTER_MODE);
- wait(2);
- lcd.Clear(LCD_COLOR_BLUE);
- lcd.SetBackColor(LCD_COLOR_BLUE);
- lcd.SetTextColor(LCD_COLOR_WHITE);
- lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"DISCOVERY STM32F769NI", CENTER_MODE);
- led_green = 1;
- led_red = 0;
- width = lcd.GetXSize();
- height = lcd.GetYSize();
- while(1) {
- led_green = !led_green;
- wait(0.5);
- lcd.SetTextColor((rand()%0x1000000)|0xFF000000);
- lcd.DrawLine(rand()%width, rand()%height, rand()%width, rand()%height);
- }
- }
复制代码
|