头都大了 求大神帮帮忙!
显示.zip
(24.08 KB)
把下面这个程序导入后 LED灯没亮
程序代码:
#include<reg51.h> #include<intrins.h> unsigned char code FONT16x16[3][32]={ {0x08,0x04,0x08,0x7E,0x08,0x44,0x09,0x44, 0xFF,0xC4,0x08,0x7C,0x08,0x44,0x0A,0x44, 0x3F,0x44,0x22,0x7C,0x22,0x44,0x22,0x44, 0x22,0x44,0x3E,0x44,0x22,0x94,0x01,0x08}, {0x00,0x04,0x7F,0xFE,0x40,0x24,0x5F,0xF4, 0x41,0x04,0x41,0x04,0x41,0x44,0x4F,0xE4, 0x41,0x04,0x41,0x44,0x41,0x24,0x41,0x04, 0x5F,0xF4,0x40,0x04,0x7F,0xFC,0x40,0x04}, {0x00,0x80,0x00,0xA0,0x00,0x90,0x3F,0xFC, 0x20,0x80,0x3F,0x80,0x24,0x84,0x24,0x44, 0x3F,0xC8,0x29,0x48,0x31,0x30,0x2A,0x20, 0x24,0x60,0x4A,0x92,0x91,0x0A,0x02,0x06} }; sbit SDI=P2^1; sbit SRCLK=P2^2; sbit RCLK=P2^2; #define LineCtrl P1 void delay(unsigned int us) { while(us--); } void SendByte(unsigned char dat) { unsigned char i; for(i=0;i<8;i++) { SRCLK=0; if(dat&0x80) SDI=1; else SDI=0; SRCLK=1; dat=dat<<1; } } void Display(unsigned char *dat1,unsigned char *dat2,unsigned char *dat3) { unsigned char i; for(i=0;i<16:i++) { SendByte(dat3[2*i+1]);SendByte(dat3[2*i]); SendByte(dat2[2*i+1]);SendByte(dat2[2*i]); SendByte(dat1[2*i+1]);SendByte(dat1[2*i]); RCLK=0; _nop_(); _nop_(); _nop_(); _nop_(); LineCtrl=i; RCLK=1; delay(100); } } void main(void) { while(1) Display(FONT16X16[0],FONT16x16[1],FONT16x16[2]); }
单片机新人 求解释一下为什么会这样?