这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » MCU » 单片机与8*8点阵显示

共2条 1/1 1 跳转至

单片机与8*8点阵显示

菜鸟
2011-04-12 13:23:14     打赏
 
var m3_u = (location.protocol=='https:'?'https://ad.eepw.com.cn/www/delivery/ajs.php':'http://ad.eepw.com.cn/www/delivery/ajs.php'); var m3_r = Math.floor(Math.random()*99999999999); if (!document.MAX_used) document.MAX_used = ','; document.write ("");
各位大侠请问单片机8*8点阵如何控制它的左右移动啊?(p0口输出,p1口控制行扫描!)c语言程序该如何写啊?行扫描的上下移动的比较好写!谢谢各位啊!我是新手不知道如何写!



关键词: 单片机     点阵     显示    

菜鸟
2011-04-13 09:43:32     打赏
2楼

谢谢了呵呵!向上移动的我知道怎么写啊!就是向左右移动不知道怎么写的!请帮我看一下这个程序(向右移动的)什么意思啊?有3句看不懂啊?谢谢!
//功能:实现→向右移动
#include<reg51.h>
#define uchar unsigned char
#define uint unsigned int
uchar code TAB[]={0xFF,0xC1,0xDF,0xDF,0xC1,0xFD,0xFD,0xC1};
uchar i,t,j=0;
delay(uchar t)
{
while (t--)
{;}
}
void main(void)
{
  uchar T,Y,Q;
  while(1)
   {  
   for(Q=0;Q<8;Q++)  
    for(T=0;T<100;T++)    //速度     
 {    P1=0x01;       
    for(i=0;i<8;i++)   
     {   
     Y=TAB[i+1]*256+TAB[i];//这什么意思 为什么乘256
     Y=Y<<(7-Q)|Y>>Q; //这什么意思 
     P0=Y%256;   //什么意思 为什么要取它的摸!
     delay(60);   
     P1=P1<<1|P1>>7;   
    }  
  }
 }
}


共2条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]