#include "main.h"
void main(void)
{
SystemInit();
while(1)
{
BatteryVoltageWarning();
KeyScan();
switch (key_flag)
{
case 0: Led50 = 1;Led70 = 1;Led100 = 1; //档位指示灯全灭
MotorA = 1;MotorB = 1; //电机不转
break;
case 1: Led50 = 0;Led70 = 1;Led100 = 1; //1挡指示灯亮
MotorA = 0;MotorB = 1;
break;
case 2: Led50 = 1;Led70 = 0;Led100 = 1; //2挡指示灯亮
break;
case 3: Led50 = 1;Led70 = 1;Led100 = 0; //3挡指示灯亮
break;
default: break;
}
1