在清翔51单片机8*8 LED实现输出爱心
#include<reg52.h>
#include<intrins.h>
#define uchar unsigned char
sbit send = P3^4;
sbit open = P3^5;
sbit output = P3^6;
uchar dat,i,j;
void input(uchar dat)
{
open = 0;
for(i=0;i<8;i++)
{
if(dat & 0x01)
send = 1;
else
send = 0;
open = 1;
dat >>= 1;
open = 0;
}
}
void main()
{
uchar hang = 0;
uchar code table[] = {0xE7,0xC3,0x81,0x00,0x00,0x00,0x99,0xFF};
hang = 0x80;
while(1)
{
for(j=0;j<8;j++)
{
output = 0;
input(table[j]);
input(hang);
hang = _cror_(hang,1);
output = 1;
}
}
}
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210403173828158.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2tuYnJva2Vu,size_16,color_FFFFFF,t_70#pic_center)