AT89S52单片机与PC串口通讯,将数码管上显示的时间每隔1秒发送给PC,用C语言如何写?

[复制链接]
查看11 | 回复3 | 2012-10-11 10:52:30 | 显示全部楼层 |阅读模式
#include#define uchar unsigned char#define uintunsigned int void delay(uint z){ uint x,y; for(x=z;x>0;x--)
for(y=123;y>0;y--);} void initial(){ TMOD=0x20; //T1工作方式2 TH1=0xfd; //波特率9600bps TL1=0xfd; TR1=1;SM0=0; SM1=1;//设置方式1 8位异步收发 波特率可变 REN=1;
//允许串行口接收} ...
回复

使用道具 举报

千问 | 2012-10-11 10:52:30 | 显示全部楼层
#include#define uchar unsigned charuchar code table0[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};unsigned int counter;void delay(counter);main()
...
回复

使用道具 举报

千问 | 2012-10-11 10:52:30 | 显示全部楼层
采用串行通信,主程序中进行传输,在中断子程序实现采集...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行