-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathT.c
More file actions
60 lines (50 loc) · 715 Bytes
/
T.c
File metadata and controls
60 lines (50 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include"stc12c5a60s2.h"
#include"HJ12864.h"
sbit EN = P0^2;
sbit CW = P0^1;
sbit CK = P0^0;
#define timer0_setting 300
//1ms延时函数
//实测有极小误差 在11.0592M晶振的stc12c5a60s2单片机上
void delay_ms(uint16 n)
{
uint8 x,y;
for(;n>0;n--)
for(x=25;x>0;x--)
for(y=100;y>0;y--)
;
}
/*
void main(void)
{
EN = 0;
CW = 1;
CK = 0;
TH0 = (65536-timer0_setting)/256;
TL0 = (65536-timer0_setting)%256;
TMOD = 0x01;
EA = 1;
ET0 = 1;
TR0 = 1;
while(1)
{
delay_ms(200);
CW = ~CW;
}
}
void timer0_interrupt(void) interrupt 1
{
TH0 = (65536-timer0_setting)/256;
TL0 = (65536-timer0_setting)%256;
CK = ~CK;
}
*/
void main(void)
{
ufloat a=0,i;
for(i=0;i<10;i++)
{
a++;
}
while(1);
}