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_4 _Wave/main.h

31 lines
544 B
C
Raw Normal View History

2022-04-07 14:02:15 +00:00
#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λ<36><CEBB>ʱ T1 16λ<36><CEBB><EFBFBD><EFBFBD>
TH0 = 0X4C;
TL0 = 0X0D;
TH1 = 0X00;
TL1 = 0X00;
EA = 1; //<2F><><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><D0B6>ܿ<EFBFBD><DCBF><EFBFBD>
ET0 = 1; //<2F>򿪶<EFBFBD>ʱ<EFBFBD><CAB1>0<EFBFBD>жϿ<D0B6><CFBF><EFBFBD>
TR0 = 1; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>0
TR1 = 1; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>1
P1 = 0X00;
}
#endif