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