SPKT
Dependencies: mbed LCD_DISCO_F746NG BSP_DISCO_F746NG
main.cpp@0:f1552b338f7b, 2019-06-04 (annotated)
- Committer:
- phungductung
- Date:
- Tue Jun 04 09:06:10 2019 +0000
- Revision:
- 0:f1552b338f7b
SPKT
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
phungductung | 0:f1552b338f7b | 1 | #include "mbed.h" |
phungductung | 0:f1552b338f7b | 2 | #include "LCD_DISCO_F746NG.h" |
phungductung | 0:f1552b338f7b | 3 | #include "stdio.h" |
phungductung | 0:f1552b338f7b | 4 | LCD_DISCO_F746NG lcd; |
phungductung | 0:f1552b338f7b | 5 | int i ; |
phungductung | 0:f1552b338f7b | 6 | |
phungductung | 0:f1552b338f7b | 7 | DigitalOut led1(LED1); |
phungductung | 0:f1552b338f7b | 8 | |
phungductung | 0:f1552b338f7b | 9 | int main() |
phungductung | 0:f1552b338f7b | 10 | { |
phungductung | 0:f1552b338f7b | 11 | led1 = 1; |
phungductung | 0:f1552b338f7b | 12 | |
phungductung | 0:f1552b338f7b | 13 | |
phungductung | 0:f1552b338f7b | 14 | lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"NHOM 7", CENTER_MODE); |
phungductung | 0:f1552b338f7b | 15 | wait(1); |
phungductung | 0:f1552b338f7b | 16 | |
phungductung | 0:f1552b338f7b | 17 | while(1) |
phungductung | 0:f1552b338f7b | 18 | { |
phungductung | 0:f1552b338f7b | 19 | led1 = !led1; |
phungductung | 0:f1552b338f7b | 20 | lcd.Clear(LCD_COLOR_BLUE); |
phungductung | 0:f1552b338f7b | 21 | lcd.SetBackColor(LCD_COLOR_BLUE); |
phungductung | 0:f1552b338f7b | 22 | lcd.SetTextColor(LCD_COLOR_WHITE); |
phungductung | 0:f1552b338f7b | 23 | wait(0.3); |
phungductung | 0:f1552b338f7b | 24 | lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"CHOP TAT LED", CENTER_MODE); |
phungductung | 0:f1552b338f7b | 25 | wait(1); |
phungductung | 0:f1552b338f7b | 26 | led1 = !led1; |
phungductung | 0:f1552b338f7b | 27 | lcd.Clear(LCD_COLOR_GREEN); |
phungductung | 0:f1552b338f7b | 28 | |
phungductung | 0:f1552b338f7b | 29 | lcd.SetTextColor(LCD_COLOR_BLUE); |
phungductung | 0:f1552b338f7b | 30 | lcd.DrawRect(10, 20, 50, 50); |
phungductung | 0:f1552b338f7b | 31 | wait(0.1); |
phungductung | 0:f1552b338f7b | 32 | led1 = !led1; |
phungductung | 0:f1552b338f7b | 33 | lcd.SetTextColor(LCD_COLOR_BROWN); |
phungductung | 0:f1552b338f7b | 34 | lcd.DrawCircle(80, 80, 50); |
phungductung | 0:f1552b338f7b | 35 | wait(0.1); |
phungductung | 0:f1552b338f7b | 36 | led1 = !led1; |
phungductung | 0:f1552b338f7b | 37 | lcd.SetTextColor(LCD_COLOR_YELLOW); |
phungductung | 0:f1552b338f7b | 38 | lcd.DrawEllipse(150, 150, 50, 100); |
phungductung | 0:f1552b338f7b | 39 | wait(0.1); |
phungductung | 0:f1552b338f7b | 40 | lcd.SetTextColor(LCD_COLOR_RED); |
phungductung | 0:f1552b338f7b | 41 | lcd.FillCircle(200, 200, 40); |
phungductung | 0:f1552b338f7b | 42 | wait(1); |
phungductung | 0:f1552b338f7b | 43 | lcd.SetTextColor(LCD_COLOR_BLUE); |
phungductung | 0:f1552b338f7b | 44 | lcd.FillCircle(250, 200, 40); |
phungductung | 0:f1552b338f7b | 45 | wait(1); |
phungductung | 0:f1552b338f7b | 46 | led1 = !led1; |
phungductung | 0:f1552b338f7b | 47 | lcd.SetTextColor(LCD_COLOR_DARKCYAN); |
phungductung | 0:f1552b338f7b | 48 | lcd.FillCircle(300, 200, 40); |
phungductung | 0:f1552b338f7b | 49 | wait(1); |
phungductung | 0:f1552b338f7b | 50 | led1 = !led1; |
phungductung | 0:f1552b338f7b | 51 | lcd.SetBackColor(LCD_COLOR_ORANGE); |
phungductung | 0:f1552b338f7b | 52 | lcd.SetTextColor(LCD_COLOR_CYAN); |
phungductung | 0:f1552b338f7b | 53 | for(i=0;i<9999;i++) |
phungductung | 0:f1552b338f7b | 54 | lcd.DisplayStringAt(0, LINE(5),(uint8_t*)"16119", CENTER_MODE); |
phungductung | 0:f1552b338f7b | 55 | wait(1); |
phungductung | 0:f1552b338f7b | 56 | } |
phungductung | 0:f1552b338f7b | 57 | } |