久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

專(zhuān)注電子技術(shù)學(xué)習(xí)與研究
當(dāng)前位置:單片機(jī)教程網(wǎng) >> MCU設(shè)計(jì)實(shí)例 >> 瀏覽文章

51單片機(jī)驅(qū)動(dòng)點(diǎn)陣16*16上移C程序

作者:佚名   來(lái)源:本站原創(chuàng)   點(diǎn)擊數(shù):  更新時(shí)間:2012年07月04日   【字體:

 

#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
#define LINE P0//定義行線IO口,即74HC154控制端
#define shudu 20//字移動(dòng)的速度
sbit DATA=P1^4;//74HC595數(shù)據(jù)端
sbit CLK=P1^5;//74HC595移位脈沖端
sbit CLKR=P1^6;//74HC595數(shù)據(jù)鎖存端
uchar move;//移動(dòng)幾位變量
uchar line;//行變量
uchar word;//字節(jié)變量
uchar ji;//字節(jié)變量
uchar code table[]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x10,0x3F,0xF8,0x04,0x10,0x04,0x14,0xFF,0xFE,0x04,0x10,0x04,0x10,
0x3F,0xF0,0x04,0x10,0x04,0x00,0x08,0x00,0x08,0x00,0x10,0x00,0x20,0x00,0x40,0x00,
0x01,0x00,0x01,0x08,0x7F,0xFC,0x01,0x00,0x3F,0xF8,0x01,0x00,0xFF,0xFE,0x00,0x10,
0x1F,0xF8,0x10,0x10,0x1F,0xF0,0x10,0x10,0x1F,0xF0,0x10,0x10,0x10,0x50,0x10,0x20,
0x01,0x10,0xFF,0x90,0x14,0x50,0x14,0x7C,0x7F,0x50,0x55,0x90,0x55,0x10,0x57,0xFE,
0x61,0x04,0x41,0x7E,0x41,0x44,0x7F,0x44,0x41,0x44,0x41,0x44,0x7F,0x7C,0x41,0x44,
0x00,0x78,0x3F,0x80,0x11,0x10,0x09,0x20,0x7F,0xFE,0x42,0x02,0x82,0x04,0x7F,0xF8,
0x04,0x00,0x07,0xF0,0x0A,0x20,0x09,0x40,0x10,0x80,0x11,0x60,0x22,0x1C,0x0C,0x08,
0x04,0x40,0x04,0x44,0xFF,0xFE,0x04,0x40,0x08,0x7C,0x09,0x44,0x7F,0xC4,0x08,0x7C,
0x0A,0x44,0x3F,0x44,0x22,0x7C,0x22,0x44,0x22,0x44,0x3E,0x44,0x22,0x94,0x01,0x08,
0x08,0x20,0x08,0x24,0xFF,0xFE,0x08,0x20,0x01,0x08,0x3F,0xFC,0x20,0x08,0x20,0x08,
0x3F,0xF8,0x20,0x08,0x20,0x00,0x20,0x00,0x20,0x00,0x40,0x00,0x40,0x00,0x80,0x00,
0x08,0x10,0x08,0x10,0x08,0x10,0x10,0x20,0x10,0x20,0x22,0x44,0x7E,0xFC,0x04,0x08,
0x08,0x10,0x10,0x20,0x20,0x40,0x7E,0xFC,0x00,0x00,0x00,0x04,0xFF,0xFE,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
void delay(uchar z)
{
 uchar x,y;
 for(x=8;x>0;x--)
 for(y=z;y>0;y--);
}
void song(uchar z)//帶參數(shù)函數(shù)
{
 uchar num,hang;//定義變量
 hang=z;//將形參給變量
 for(num=0;num<8;num++)//移動(dòng)8次將數(shù)據(jù)發(fā)送完畢
 {
  if(hang&0x01==1)//將高7位屏蔽掉,保留最低位判斷
  DATA=1;//為1就將74HC595數(shù)據(jù)端置1
  else
  DATA=0;//否則給0
  CLK=0;//上升沿送走數(shù)據(jù)
  CLK=1;//高電平形成上升沿
  hang>>=1;//將數(shù)移走一位
 }
}
void shang()
{
 for(move=10;move>0;move--)
 {
  ji=word;
  for(line=0;line<16;line++)
  {
   song(~table[ji*2+1]);
   song(~table[ji*2]);
   ji++;
   CLKR=1;//在74HC595處鎖存起來(lái)
   CLKR=0;
   CLKR=1;
   LINE=line;
   delay(10);
  }
 }
 word+=1;
 if(word>=128)//7個(gè)字
 {
  ji=0;
  word=0;
 } 
}
void main()
{
 while(1)
 {
  shang();
 }
}

 完整的源碼下載地址:http://www.zg4o1577.cn/f/dzsy.rar

視頻祥見(jiàn):http://www.tudou.com/programs/view/D0SCJyO4RBQ/

 

關(guān)閉窗口

相關(guān)文章

主站蜘蛛池模板: 国产精品99久久久久久www | 国产永久免费 | 日韩中文字幕一区 | 欧美精品久久 | 久久福利网站 | 亚洲一区二区电影在线观看 | re久久| 亚洲精品久久久一区二区三区 | 国产69精品久久久久777 | 国产精品一区二区视频 | 国产在线视频在线观看 | 国产视频一区在线观看 | 国产精品视频久久久 | 亚洲黄色在线免费观看 | 亚洲免费观看视频 | 国产精品一区二区三区四区 | 亚洲欧洲色视频 | 亚洲视频在线免费观看 | 视频第一区 | 午夜在线 | 亚洲精品一区二区在线观看 | 国产午夜亚洲精品不卡 | 亚洲精品在线视频 | 成人一区二区视频 | 天天澡天天狠天天天做 | 九九色综合 | a黄视频| 日本三级黄视频 | 人人看人人搞 | 国产欧美日韩在线观看 | 精品久久久久久中文字幕 | 中文字幕一区二区三区四区 | 亚洲国产精品va在线看黑人 | 在线视频一区二区三区 | 日韩免 | 野狼在线社区2017入口 | 欧美激情久久久 | 欧美舔穴 | 日韩成人影院 | 日韩乱码av | 欧美日韩亚洲视频 |