Připojení k Arduinu
Pin TIL311 | Název pinu TIL311 | Pin Arduino |
---|
1 | LED SUPPLY VOLTAGE | 5V |
2 | LATCH DATA INPUT B | D3 |
3 | LATCH DATA INPUT A | D2 |
4 | LEFT DECIMAL POINT CATHODE | – |
5 | STROBE | GND |
6 | NC | – |
7 | GND | GND |
8 | BLANKING INPUT | D6 |
9 | NC | – |
10 | RIGHT DECIMAL POINT CATHODE | – |
11 | NC | – |
12 | LATCH DATA INPUT D | D5 |
13 | LATCH DATA INPUT C | D4 |
14 | LOGIC SUPPLY VOLTAGE (Vcc) | 5V |
Zdrojový kód pro Arduino
#define BLANK_INPUT 6
#define LATCH_DATA_A 2
#define LATCH_DATA_B 3
#define LATCH_DATA_C 4
#define LATCH_DATA_D 5
void display (uint8_t value)
{
digitalWrite (LATCH_DATA_A, bitRead (value, 0));
digitalWrite (LATCH_DATA_B, bitRead (value, 1));
digitalWrite (LATCH_DATA_C, bitRead (value, 2));
digitalWrite (LATCH_DATA_D, bitRead (value, 3));
}
void setup ()
{
pinMode (BLANK_INPUT, OUTPUT);
pinMode (LATCH_DATA_A, OUTPUT);
pinMode (LATCH_DATA_B, OUTPUT);
pinMode (LATCH_DATA_C, OUTPUT);
pinMode (LATCH_DATA_D, OUTPUT);
digitalWrite (BLANK_INPUT, LOW);
}
void loop ()
{
static byte i = 0;
display (i++);
if (i > 15) i = 0;
delay (300);
}
Demo video
TIL311, DIS1417 a DIALCO 980-8431 (shora dolů)