Připojení k Arduinu
Pin HPDL-1414 | Název pinu HPDL-1414 | Pin Arduino |
---|---|---|
1 | D6 | D10 |
2 | D4 | D9 |
3 | WR | D2 |
4 | A1 | D3 |
5 | A0 | D4 |
6 | Vdd | 5V |
7 | GND | GND |
8 | D0 | D5 |
9 | D1 | D6 |
10 | D2 | D7 |
11 | D3 | D8 |
12 | D5 | D11 |
Zdrojový kód pro Arduino
#define HPDL1414_A0 4 #define HPDL1414_A1 3 #define HPDL1414_WR 2 const byte HPDL1414_D[] = {5, 6, 7, 8, 9, 10, 11}; char msg[] = " HPDL-1414 DEMO "; void setup() { for (byte i = 0; i < 7; i++) { pinMode(HPDL1414_D[i], OUTPUT); } pinMode(HPDL1414_A0, OUTPUT); pinMode(HPDL1414_A1, OUTPUT); pinMode(HPDL1414_WR, OUTPUT); } void loop() { for (byte p = 3; p <= 20; p++) { for (byte c = 0; c < 7; c++) { digitalWrite(HPDL1414_A0, bitRead(c, 0)); digitalWrite(HPDL1414_A1, bitRead(c, 1)); for (byte i = 0; i < 7; i++) { digitalWrite(HPDL1414_D[i], bitRead(msg[p - c], i)); } if (c < 4) { digitalWrite(HPDL1414_WR, LOW); digitalWrite(HPDL1414_WR, HIGH); } } delay(300); } }
Demo video
Pages: 1 2