const int dataPin1 = 2; /* DS */
const int clockPin1 = 3; /* SHCP */
const int latchPin1 = 4; /* STCP */
int zero;
int one;
int two;
int three;
int four;
int five;
int six;
int seven;
int eight;
int nine;
//int DecimalCodes[] = {252, 96, 218, 242, 102, 182, 190, 224, 254, 246};
void SSDdisplay( int digitCode); //decimal code
void SSD2Digitdisplay( int MSBdigitCode,int LSBdigitCode);//decimal code
void setup() {
Serial.begin(9600);
for(int i = 2; i<4; i++)
{
pinMode(i, OUTPUT);
}
zero = 252; //0b11111100; //0
one = 96; //0b01100000; //1
two = 128; //0b11011010; //2
three = 242; //0b11110010; //3
four = 102; //0b01100110; //4
five = 182; //0b10110110; //5
six = 190; //0b10111110; //6
seven = 224; //0b11100000; //7
eight = 254; //0b11111110;//8
nine = 246; //0b11110110;//9
/*
SSDdisplay( 190);
delay(1000);
SSDdisplay( 242);
delay(1000);
SSD2Digitdisplay(102,190);
delay(1000);
SSD2Digitdisplay(224,246);
*/
}
void loop() {
SSDdisplay( 190);
delay(1000);
SSDdisplay( 242);
delay(1000);
SSD2Digitdisplay(102,190);
delay(1000);
SSD2Digitdisplay(224,246);
delay(1000);
}
void SSDdisplay( int digitCode)//decimal code
{
digitalWrite(latchPin1, LOW);
shiftOut(dataPin1, clockPin1, LSBFIRST, digitCode);
digitalWrite(latchPin1, HIGH);
}
void SSD2Digitdisplay( int MSBdigitCode,int LSBdigitCode)//decimal code
{
digitalWrite(latchPin1, LOW);
shiftOut(dataPin1, clockPin1, LSBFIRST, LSBdigitCode);
shiftOut(dataPin1, clockPin1, LSBFIRST, MSBdigitCode);
digitalWrite(latchPin1, HIGH);
}