附录B:基于单片机方波发生器的程序清单 #include #include #define uchar unsigned char #define uint unsigned int #define KEY_PORT P1 //P1口为键盘扫描口 sbit OutPut=P0^7; //矩形波输出口 /* 设全局变量 */ float fosc=11059200; //系统时钟频率 float length=65536; //方式1计数长度 uchar flag; //状态键标志 uchar ZKB; //占空比 uint PL; //频率 uchar TIMER0_L,TIMER0_H,TIMER1_L,TIMER1_H; //定时器0和1的定时初值 uchar code tabl[12]= {0xfc,0x60,0xda,0xf2,0x66,0xb6,0xbe,0xe0,0xfe,0xf6,0x00}; //LED共阴极代码 uchar code tabl2[18]= {0x11,0x12,0x14,0x18,0x21,0x22,0x24,0
2022-06-19 18:04:04
24KB
文档资料