用C语言写51单片机串口通信的代码

下面是一份 C 语言代码示例,用于在 51 单片机上进行串口通信:

#include <reg52.h>
#include <stdio.h>

#define uint unsigned int
#define uchar unsigned char

sbit LED = P2^7;

uchar code table[] = "Hello World!";

void serial() interrupt 4
{
    if(RI)
    {
        LED = ~LED;
        RI = 0;
    }
}

void main()
{
    TMO

猜你喜欢

转载自blog.csdn.net/weixin_42599558/article/details/129524110