This repository has been archived on 2024-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
justhomework/MCU/MCU_3 _Wave/main.h

31 lines
544 B
C

#ifndef _MAIN_H_
#define _MAIN_H_
unsigned long int count = 0;
#define RELOAD (65535-46080)
unsigned int TH, TL;
const unsigned char num_var[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
unsigned int ge,ui,bd,qm,wj,num;
void setConfig()
{
TH = RELOAD / 256;
TL = RELOAD - (RELOAD / 256) * 256;
TMOD = 0x51; //T0 16位定时 T1 16位计数
TH0 = 0X4C;
TL0 = 0X0D;
TH1 = 0X00;
TL1 = 0X00;
EA = 1; //打开中断总开关
ET0 = 1; //打开定时器0中断开关
TR0 = 1; //启动定时器0
TR1 = 1; //启动定时器1
P1 = 0X00;
}
#endif