/*
NEC FM20X2AA-DA
PINOUT:
+--+
GND |..| D7 - Arduino pin 7
GND |..| D6 - Arduino pin 6
GND |..| D5 - Arduino pin 5
GND |..| D4 - Arduino pin 4
GND |..| D3 - Arduino pin 3
GND |..| D2 - Arduino pin 2
GND |..| D1 - Arduino pin 1
GND |..| D0 - Arduino pin 0
GND |..| ?? - Arduino pin 8
GND |..| ?? - Arduino pin 9
GND |..| ?? - Arduino pin 10
GND |..| ?? - Arduino pin 11
GND |..| SELFTEST - Arduino pin 12
+--+
SELFTEST = LOW bij inschakelen spanning => Zelftest.
*/
int D0 = 0;
int D1 = 1;
int D2 = 2;
int D3 = 3;
int D4 = 4;
int D5 = 5;
int D6 = 6;
int D7 = 7;
int LEDPIN = 13;
int SELFTEST = 12;
void setup() {
pinMode(D0,OUTPUT);
pinMode(D1,OUTPUT);
pinMode(D2,OUTPUT);
pinMode(D3,OUTPUT);
pinMode(D4,OUTPUT);
pinMode(D5,OUTPUT);
pinMode(D6,OUTPUT);
pinMode(D7,OUTPUT);
pinMode(LEDPIN,OUTPUT);
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
pinMode(10,OUTPUT);
pinMode(11,OUTPUT);
pinMode(SELFTEST,OUTPUT);
digitalWrite(8,LOW);
digitalWrite(9,LOW);
digitalWrite(10,HIGH);
digitalWrite(11,LOW);
digitalWrite(SELFTEST,HIGH);
digitalWrite(10,HIGH); setStates(72); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(69); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(76); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(76); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(79); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(32); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(87); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(79); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(82); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(76); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(68); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(33); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(32); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(32); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(32); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(32); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(32); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(32); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(32); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(32); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(87); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(87); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(87); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(46); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(74); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(79); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(83); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(86); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(65); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(78); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(68); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(73); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(74); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(75); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(69); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(78); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(46); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(78); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(76); digitalWrite(10,LOW);delay(100);
digitalWrite(10,HIGH); setStates(32); digitalWrite(10,LOW);delay(100);
}
void loop()
{
}
void setStates(byte states){
zeroStates();
if (states & 1) digitalWrite(D0, HIGH);
if (states & 2) digitalWrite(D1, HIGH);
if (states & 4) digitalWrite(D2, HIGH);
if (states & 8) digitalWrite(D3, HIGH);
if (states & 16) digitalWrite(D4, HIGH);
if (states & 32) digitalWrite(D5, HIGH);
if (states & 64) digitalWrite(D6, HIGH);
if (states & 128) digitalWrite(D7, HIGH);
}
void zeroStates(){
digitalWrite(D0, LOW);
digitalWrite(D1, LOW);
digitalWrite(D2, LOW);
digitalWrite(D3, LOW);
digitalWrite(D4, LOW);
digitalWrite(D5, LOW);
digitalWrite(D6, LOW);
digitalWrite(D7, LOW);
}