![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
11
Dependencies: mbed N5110 Joystick
start/start.cpp@2:4fd751cc1af7, 2021-04-14 (annotated)
- Committer:
- lhyr
- Date:
- Wed Apr 14 14:12:26 2021 +0000
- Revision:
- 2:4fd751cc1af7
- Parent:
- 1:77e6588be25b
1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lhyr | 0:283702b9a078 | 1 | #include "start.h" |
lhyr | 0:283702b9a078 | 2 | #include "lcd.h" |
lhyr | 2:4fd751cc1af7 | 3 | #include "gaming.h" |
lhyr | 0:283702b9a078 | 4 | |
lhyr | 2:4fd751cc1af7 | 5 | void select11( int *button_a_flag, int *button_d_flag,int *button_b_flag) { //函数定义 |
lhyr | 0:283702b9a078 | 6 | int x = 19,y = 18; |
lhyr | 0:283702b9a078 | 7 | DigitalOut led2(LED2); |
lhyr | 0:283702b9a078 | 8 | while(1) { |
lhyr | 0:283702b9a078 | 9 | lcd_init(); |
lhyr | 0:283702b9a078 | 10 | lcd_clear(); |
lhyr | 0:283702b9a078 | 11 | print_GUI(); |
lhyr | 0:283702b9a078 | 12 | upper_T1(); |
lhyr | 0:283702b9a078 | 13 | lcd_refresh(); |
lhyr | 0:283702b9a078 | 14 | led2=button_b_flag[0]; |
lhyr | 0:283702b9a078 | 15 | while(1){ |
lhyr | 0:283702b9a078 | 16 | |
lhyr | 2:4fd751cc1af7 | 17 | if (*button_b_flag){ |
lhyr | 2:4fd751cc1af7 | 18 | *button_b_flag = 0; |
lhyr | 0:283702b9a078 | 19 | led2=!led2; |
lhyr | 0:283702b9a078 | 20 | y = 18; |
lhyr | 0:283702b9a078 | 21 | lcd_clear(); |
lhyr | 0:283702b9a078 | 22 | print_GUI(); |
lhyr | 0:283702b9a078 | 23 | upper_T1(); |
lhyr | 0:283702b9a078 | 24 | lcd_refresh(); |
lhyr | 0:283702b9a078 | 25 | } |
lhyr | 0:283702b9a078 | 26 | |
lhyr | 2:4fd751cc1af7 | 27 | if (*button_d_flag){ |
lhyr | 2:4fd751cc1af7 | 28 | *button_d_flag = 0; |
lhyr | 0:283702b9a078 | 29 | y = 26; |
lhyr | 0:283702b9a078 | 30 | lcd_clear(); |
lhyr | 0:283702b9a078 | 31 | print_GUI(); |
lhyr | 0:283702b9a078 | 32 | lower_T1(); |
lhyr | 0:283702b9a078 | 33 | lcd_refresh(); |
lhyr | 0:283702b9a078 | 34 | } |
lhyr | 0:283702b9a078 | 35 | |
lhyr | 2:4fd751cc1af7 | 36 | if (*button_a_flag && y == 18){ |
lhyr | 2:4fd751cc1af7 | 37 | *button_a_flag = 0; |
lhyr | 2:4fd751cc1af7 | 38 | gaming(); |
lhyr | 0:283702b9a078 | 39 | } |
lhyr | 2:4fd751cc1af7 | 40 | if (*button_a_flag && y == 26){ |
lhyr | 2:4fd751cc1af7 | 41 | *button_a_flag = 0; |
lhyr | 0:283702b9a078 | 42 | print_menu(); |
lhyr | 0:283702b9a078 | 43 | } |
lhyr | 0:283702b9a078 | 44 | }//第二个while |
lhyr | 0:283702b9a078 | 45 | |
lhyr | 0:283702b9a078 | 46 | |
lhyr | 0:283702b9a078 | 47 | |
lhyr | 0:283702b9a078 | 48 | }//对应第一个while循环 |
lhyr | 0:283702b9a078 | 49 | }//对应总函数 |
lhyr | 0:283702b9a078 | 50 | |
lhyr | 0:283702b9a078 | 51 | |
lhyr | 0:283702b9a078 | 52 | |
lhyr | 0:283702b9a078 | 53 | |
lhyr | 0:283702b9a078 | 54 |