“(SKU:RB-05L009)8*8點陣模塊”的版本間的差異
來自ALSROBOT WiKi
(→?例子程序) |
(→?例子程序) |
||
第30行: | 第30行: | ||
===例子程序=== | ===例子程序=== | ||
<pre style='color:blue'> | <pre style='color:blue'> | ||
? | + | //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() { |
? | void setup() { | + | for(int i = 0; i < 8; i++){ |
? | pinMode( | + | for(int j = 0; j < 8; j++){ |
? | pinMode( | + | digitalWrite(latchPin, LOW); |
? | pinMode( | + | // shiftOut(dataPin, clockPin, LSBFIRST, (0xff-(1<<i))); |
? | } | + | shiftOut(dataPin, clockPin, LSBFIRST, tab[i]); |
? | void loop() { | + | shiftOut(dataPin, clockPin, LSBFIRST, 0xff); |
? | for( | + | digitalWrite(latchPin, HIGH); |
? | for( | + | delay(50); |
? | + | } | |
? | shiftOut( | + | } |
? | shiftOut( | + | for(int i = 0; i < 8; i++){ |
? | + | for(int j = 0; j < 8; j++){ | |
? | + | digitalWrite(latchPin, LOW); | |
? | } | + | // shiftOut(dataPin, clockPin, LSBFIRST, (0xff-(1<<i))); |
? | for( | + | shiftOut(dataPin, clockPin, LSBFIRST, 0x00); |
? | for( | + | shiftOut(dataPin, clockPin, LSBFIRST, tab[i]); |
? | + | digitalWrite(latchPin, HIGH); | |
? | shiftOut( | + | delay(50); |
? | + | } | |
? | + | } | |
? | + | ||
? | + | ||
? | + | ||
? | + | ||
? | shiftOut( | + | |
? | shiftOut( | + | |
? | + | ||
? | + | ||
? | } | + | |
} | } | ||
</pre> | </pre> |
2016年3月3日 (四) 17:39的版本
目錄 |
產(chǎn)品概述
- 還在為驅(qū)動點陣連接復(fù)雜的接線煩惱嗎?還在為 Arduino 控制器屈指可數(shù)的 I/O 資源犯愁嗎?2013 最新推出的 8X8 LED Matrix Module v1.0 點陣模塊是哈爾濱奧松機器人科技有限公司研發(fā)的一款易安裝、易連接、可拓展的 8X8 點陣模塊。此模塊采用高速的 74HC595 串并轉(zhuǎn)換芯片。SPI 接口,僅需要 3 根信號線即可驅(qū)動多塊 8x8 點陣屏,最大限度的節(jié)省您寶貴的 Arduino 控制器 I/O 資源。行列信號全部傳輸完畢后再更新顯示,顯示亮麗,可靠性高。適合于 Arduino UNO328 控制器、STC 單片機、AVR 單片機等。
規(guī)格參數(shù)
- 產(chǎn)品名稱:8*8點陣模塊
- 產(chǎn)品貨號:RB-05L009
- 工作電壓:DC5V
- 產(chǎn)品類型:顯示輸出
- 制作工藝:FR4雙面噴錫
- 固定孔尺寸:3.2mm
- 對角固定孔間距:22.67mm
- 固定孔距板邊緣:7.93mm
- 人性化設(shè)計:可級聯(lián)應(yīng)用顯示
- 工作溫度:10℃-30℃
- 工作濕度:10%~90% 無凝結(jié)
- 重量:12g
- 產(chǎn)品尺寸:32mm x 32mm x 23mm
使用方法
使用硬件
- Carduino UNO 控制器 * 1個
- Carduino UNO 傳感器擴展板 v5.0 * 1個
- 8X8 LED Matrix Module v1.0 * 1個
- 3P 通用連接線 * 1條
- 2P 電源線 * 1組
- USB 數(shù)據(jù)通信線 * 1條
接線方法
- 通過 SPI 通信方式中的 DIN、CLK、LTH 對 LED 點陣進(jìn)行控制。DIN 為數(shù)據(jù),CLK為時鐘,LTH 為鎖存。
- 將 8X8 點陣模塊的 DIN、CLK、LTH 分別連接到 Arduino 傳感器擴展板的數(shù)字 4、5、6 引腳,VCC、GND 分別連接到傳感器擴展板的任意一個 V、G 端口。最后連接Arduino 控制器至計算機。
例子程序
//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); } } }
程序效果
產(chǎn)品相關(guān)推薦
購買地址
周邊產(chǎn)品推薦
Arduino LCD12864 點陣液晶擴展板 12864液晶屏
Arduino 12864點陣液晶 51單片機
相關(guān)問題解答
8*8點陣模塊桃心呼吸燈效果 求助
8x8點陣程序燒進(jìn)去,顯示的圖案沒有規(guī)律