“(SKU:RB-05L009)8*8點(diǎn)陣模塊”的版本間的差異

來(lái)自ALSROBOT WiKi
跳轉(zhuǎn)至: 導(dǎo)航、 搜索
?例子程序
?例子程序
第30行: 第30行:
 
===例子程序===  
 
===例子程序===  
 
<pre style='color:blue'>
 
<pre style='color:blue'>
?
const int DINPin = 4;            // 數(shù)據(jù)引腳  連接到數(shù)字 4 口
+
//Pin connected to ST_CP of 74HC595
?
const int CLKPin = 5;             // 時(shí)鐘引腳  連接到數(shù)字 5 口
+
int latchPin = 6;
?
const int LTHPin = 6;             //鎖存引腳  連接到數(shù)字 6 口
+
//Pin connected to SH_CP of 74HC595
?
byte LieScan[16] = {                                    //列掃描,點(diǎn)陣只點(diǎn)亮一行
+
int clockPin = 5;
?
0xFE,0xFD,0xFB,0xF7,0xEF,0xDF,0xBF,0x7F
+
////Pin connected to DS of 74HC595
?
};
+
int dataPin = 4;
?
byte HanZi_1[] = {
+
int tab[]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe};
?
0x1c,0x3e,0x7e,0xfc,0xfc,0x7e,0x3e,0x1c            //心形圖案
+
void setup() {
?
};
+
  //set pins to output because they are addressed in the main loop
?
byte HanZi_2[] = {
+
  pinMode(latchPin, OUTPUT);
?
0x1c,0x3e,0x7e,0xfc,0xfc,0x7e,0x3e,0x1c            //心形圖案
+
  pinMode(clockPin, OUTPUT);
?
};  
+
  pinMode(dataPin, OUTPUT);
?
byte HanZi_3[] = {  
+
}
?
0x1c,0x3e,0x7e,0xfc,0xfc,0x7e,0x3e,0x1c            //心形圖案
+
 
?
};  
+
void loop() {
?
void setup() {  
+
  for(int i = 0; i < 8; i++){
?
pinMode(DINPin,OUTPUT);         //設(shè)置數(shù)據(jù)引腳為輸出
+
    for(int j = 0; j < 8; j++){
?
pinMode(CLKPin,OUTPUT);         //設(shè)置鎖存引腳為輸出
+
      digitalWrite(latchPin, LOW);
?
pinMode(LTHPin,OUTPUT);         //設(shè)置時(shí)鐘引腳為輸出
+
//      shiftOut(dataPin, clockPin, LSBFIRST, (0xff-(1<<i)));  
?
}  
+
      shiftOut(dataPin, clockPin, LSBFIRST, tab[i]);
?
void loop() {  
+
      shiftOut(dataPin, clockPin, LSBFIRST, 0xff);  
?
for(unsigned char times_1 = 0;times_1 <250;t imes_1++) {   //持續(xù)刷新 250 次
+
      digitalWrite(latchPin, HIGH);
?
for(char x = 0;x <9;x++) {
+
      delay(50);   
?
}
+
    }
?
shiftOut( DI NP in, CLKP in, MSBFIRST, LieScan[x]);   // 先選擇列
+
  }
?
shiftOut( DI NP in, CLKP in, MSBFIRST, HanZi_1[x]);   // 再送行數(shù)據(jù)
+
    for(int i = 0; i < 8; i++){
?
digit alWr ite(LTHP in, LOW);     //刷新顯示
+
    for(int j = 0; j < 8; j++){
?
digit alWr ite(LTHP in, HIGH);   
+
      digitalWrite(latchPin, LOW);
?
}  
+
//     shiftOut(dataPin, clockPin, LSBFIRST, (0xff-(1<<i)));   
?
for(unsigned char times_2 = 0;times_2 <250;t imes_2++) {   //持續(xù)刷新 250 次
+
      shiftOut(dataPin, clockPin, LSBFIRST, 0x00);
?
for(char x = 0;x <8;x++) {  
+
      shiftOut(dataPin, clockPin, LSBFIRST, tab[i]);  
?
shiftOut( DI NP in, CLKP in, MSBFIRST, LieScan[x]);   // 先選擇列
+
      digitalWrite(latchPin, HIGH);  
?
shiftOut( DI NP in, CLKPin, MSBFIRST, HanZi_2[x]);    // 再送行數(shù)據(jù)
+
      delay(50);   
?
digit alWr ite(LTHP in, LOW);      //刷新顯示
+
    }
?
digit alWr ite(LTHP in, HIGH);
+
  }
?
}
+
?
}
+
?
for(unsigned char times_3 = 0;times_3 <250;t imes_3++) {   //持續(xù)刷新 250 次
+
?
for(char x = 0;x <8;x++) {
+
?
shiftOut( DI NP in, CLKP in, MSBF IRST, LieS can[x]);   //先選擇列
+
?
shiftOut( DI NP in, CLKP in, MSBFIRST, HanZi_3[x]);   // 再送行數(shù)據(jù)
+
?
digit alWr ite(LTHP in, LOW);     //刷新顯示
+
?
digit alWr ite(LTHP in, HIGH);   
+
?
}  
+
 
}  
 
}  
 
</pre>
 
</pre>

2016年3月3日 (四) 17:39的版本


Ewg1.jpg

目錄

產(chǎn)品概述

還在為驅(qū)動(dòng)點(diǎn)陣連接復(fù)雜的接線煩惱嗎?還在為 Arduino 控制器屈指可數(shù)的 I/O 資源犯愁嗎?2013 最新推出的 8X8 LED Matrix Module v1.0 點(diǎn)陣模塊是哈爾濱奧松機(jī)器人科技有限公司研發(fā)的一款易安裝、易連接、可拓展的 8X8 點(diǎn)陣模塊。此模塊采用高速的 74HC595 串并轉(zhuǎn)換芯片。SPI 接口,僅需要 3 根信號(hào)線即可驅(qū)動(dòng)多塊 8x8 點(diǎn)陣屏,最大限度的節(jié)省您寶貴的 Arduino 控制器 I/O 資源。行列信號(hào)全部傳輸完畢后再更新顯示,顯示亮麗,可靠性高。適合于 Arduino UNO328 控制器、STC 單片機(jī)、AVR 單片機(jī)等。

規(guī)格參數(shù)

  1. 產(chǎn)品名稱:8*8點(diǎn)陣模塊
  2. 產(chǎn)品貨號(hào):RB-05L009
  3. 工作電壓:DC5V
  4. 產(chǎn)品類型:顯示輸出
  5. 制作工藝:FR4雙面噴錫
  6. 固定孔尺寸:3.2mm
  7. 對(duì)角固定孔間距:22.67mm
  8. 固定孔距板邊緣:7.93mm
  9. 人性化設(shè)計(jì):可級(jí)聯(lián)應(yīng)用顯示
  10. 工作溫度:10℃-30℃
  11. 工作濕度:10%~90% 無(wú)凝結(jié)
  12. 重量:12g
  13. 產(chǎn)品尺寸:32mm x 32mm x 23mm

使用方法

使用硬件

  • Carduino UNO 控制器 * 1個(gè)
  • Carduino UNO 傳感器擴(kuò)展板 v5.0 * 1個(gè)
  • 8X8 LED Matrix Module v1.0 * 1個(gè)
  • 3P 通用連接線 * 1條
  • 2P 電源線 * 1組
  • USB 數(shù)據(jù)通信線 * 1條

接線方法

通過(guò) SPI 通信方式中的 DIN、CLK、LTH 對(duì) LED 點(diǎn)陣進(jìn)行控制。DIN 為數(shù)據(jù),CLK為時(shí)鐘,LTH 為鎖存。
將 8X8 點(diǎn)陣模塊的 DIN、CLK、LTH 分別連接到 Arduino 傳感器擴(kuò)展板的數(shù)字 4、5、6 引腳,VCC、GND 分別連接到傳感器擴(kuò)展板的任意一個(gè) V、G 端口。最后連接Arduino 控制器至計(jì)算機(jī)。

例子程序

//Pin connected to ST_CP of 74HC595
int latchPin = 6;
//Pin connected to SH_CP of 74HC595
int clockPin = 5;
////Pin connected to DS of 74HC595
int dataPin = 4;
int tab[]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe};
void setup() {
  //set pins to output because they are addressed in the main loop
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
}

void loop() {
  for(int i = 0; i < 8; i++){
    for(int j = 0; j < 8; j++){
      digitalWrite(latchPin, LOW);
//      shiftOut(dataPin, clockPin, LSBFIRST, (0xff-(1<<i)));   
      shiftOut(dataPin, clockPin, LSBFIRST, tab[i]);
      shiftOut(dataPin, clockPin, LSBFIRST, 0xff); 
      digitalWrite(latchPin, HIGH); 
      delay(50);  
    }
  }
    for(int i = 0; i < 8; i++){
    for(int j = 0; j < 8; j++){
      digitalWrite(latchPin, LOW);
//      shiftOut(dataPin, clockPin, LSBFIRST, (0xff-(1<<i)));   
      shiftOut(dataPin, clockPin, LSBFIRST, 0x00);
      shiftOut(dataPin, clockPin, LSBFIRST, tab[i]); 
      digitalWrite(latchPin, HIGH); 
      delay(50);  
    }
  }
} 

程序效果

Ewg2.jpg

產(chǎn)品相關(guān)推薦

Erweima.png

購(gòu)買地址

8*8點(diǎn)陣模塊

周邊產(chǎn)品推薦

Arduino LCD12864 點(diǎn)陣液晶擴(kuò)展板 12864液晶屏
Arduino 12864點(diǎn)陣液晶 51單片機(jī)

相關(guān)問(wèn)題解答

8*8點(diǎn)陣模塊桃心呼吸燈效果 求助
8x8點(diǎn)陣程序燒進(jìn)去,顯示的圖案沒(méi)有規(guī)律

相關(guān)學(xué)習(xí)資料

用戶手冊(cè)
奧松機(jī)器人技術(shù)論壇