-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Nixie_Shield_Basic_Example.ino
49 lines (38 loc) · 1.39 KB
/
Nixie_Shield_Basic_Example.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Nixie Shield Basic Example
This example shows how to control a nixie tube with an Arduino using Nixie Shield
Nixie Shield uses five digital outputs to drive nixie tube.
Pin A0 as on/off line, 13,12,11,10 as an address of nixie tube cathode.
This example code is in the public domain.
http://www.nixietester.com
*/
const int EN = A0; // A0 pin is attached to on/off line
const int A = 13; // 13,12,11,10 pins are attached to address lines
const int B = 12;
const int C = 11;
const int D = 10;
void setup() {
pinMode(EN, OUTPUT); // declare pin A0 as output
pinMode(A, OUTPUT); // declare pins 13,12,11,10 as output
pinMode(B, OUTPUT);
pinMode(C, OUTPUT);
pinMode(D, OUTPUT);
}
void loop() {
delay (1000);
digitalWrite(EN, LOW); //turn on the tube
// set address of the tube cathode '0':
// ___
digitalWrite(A, LOW); // | |
digitalWrite(B, LOW); // | |
digitalWrite(C, LOW); // | |
digitalWrite(D, LOW); // |___|
delay (1000);
// set address of the tube cathode '1':
digitalWrite(A, HIGH); // /|
digitalWrite(B, LOW); // / |
digitalWrite(C, LOW); // |
digitalWrite(D, LOW); // |
delay (1000);
digitalWrite(EN, HIGH); //turn off the tube
}