#include
#include "iic.h"
#define uchar unsigned char
#define uint unsigned int
uchar code tab[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0xbf,0xff,0xc6};
uchar yi,er,san,si,wu,liu,qi,ba;
uchar led_start=0;
uchar mode=1;//????
uchar set=0;//s6??
uint jiange=400;//????
uint LED_tt=0,set_tt=0,AD_tt=0;//0.8???
uint RB2=0;//AD??
uchar flag4=0;//s4????
uchar LED_n=0;
uchar Light=0,LED_T=0;
void allinit();
void Delay1ms(uint ms);
void display1(uchar yi,uchar er);
void display2(uchar san,uchar si);
void display3(uchar wu,uchar liu);
void display4(uchar qi,uchar ba);
void keyscan();
void Timer0Init(void);
void main()
{
allinit();
Timer0Init();
mode=EEPROM_Read(0x10);
Delay1ms(5);
jiange=EEPROM_Read(0x20)*100;
Delay1ms(5);
yi=11;er=11;san=11;si=11;wu=11;liu=11;qi=11;ba=11;
while(1)
{
// RB2=AD_Read(0x03);
if((set==0)&&(flag4==1))
{
if(RB2<64){yi=11;er=11;san=11;si=11;wu=11;liu=11;qi=10;ba=1;}
else if((RB2>=64)&&(RB2<128)){yi=11;er=11;san=11;si=11;wu=11;liu=11;qi=10;ba=2;}
else if((RB2>=128)&&(RB2<192)){yi=11;er=11;san=11;si=11;wu=11;liu=11;qi=10;ba=3;}
else if((RB2>=192)&&(RB2<255)){yi=11;er=11;san=11;si=11;wu=11;liu=11;qi=10;ba=4;}
}
else if(set==0)
{
yi=11;er=11;san=11;si=11;wu=11;liu=11;qi=11;ba=11;
}
keyscan();
display1(yi,er);
display2(san,si);
display3(wu,liu);
display4(qi,ba);
}
}
void keyscan()
{
if(P30==0)//s7
{