驱动一块64*32点阵板,大屏上拆下来的那种,写个测试程序,仅点亮第一行,用的是STC15单片机,屏幕无法点亮,大神帮看下程序哪里不对。
#include "STC15.H"
sbit sk = P2^6;
sbit lt = P2^7;
sbit g1 = P4^5;
sbit led_A = P0^0;
sbit led_B = P0^1;
sbit led_C = P0^2;
sbit led_D = P0^3;
unsigned char i,j;
void main()
{
P0M0=0;
P0M1=0;
P2M0=0;
P2M1=0;
P4M0=0;
P4M1=0;
while(1)
{
P0 = 0; //只显示第一行
for(j=0;j<64;j++)
{
g1 = 1; //第一行全亮
sk = 0;
sk = 1; //上升沿移位
}
lt = 0;
lt = 1; //上升沿锁存
}
}
|