11

Dependencies:   mbed N5110 Joystick

start/start.cpp

Committer:
lhyr
Date:
2021-04-14
Revision:
2:4fd751cc1af7
Parent:
1:77e6588be25b

File content as of revision 2:4fd751cc1af7:

#include "start.h"
#include "lcd.h"
#include "gaming.h"

void select11( int *button_a_flag, int *button_d_flag,int *button_b_flag) { //函数定义
    int x = 19,y = 18;
    DigitalOut led2(LED2);
    while(1) {
        lcd_init();
        lcd_clear();
        print_GUI();
        upper_T1();
        lcd_refresh();
        led2=button_b_flag[0];
            while(1){
                
                if (*button_b_flag){
                    *button_b_flag = 0;
                    led2=!led2;
                    y = 18;
                    lcd_clear();
                    print_GUI();
                    upper_T1();
                    lcd_refresh();
                }

                if (*button_d_flag){ 
                    *button_d_flag = 0;
                    y = 26;
                    lcd_clear();
                    print_GUI();
                    lower_T1();
                    lcd_refresh();
                }
                
                if (*button_a_flag && y == 18){
                    *button_a_flag = 0;
                    gaming();
                }
                if (*button_a_flag && y == 26){
                    *button_a_flag = 0;
                    print_menu();
                }
            }//第二个while
        
         
        
    }//对应第一个while循环
}//对应总函数