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);
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);
///*
/*
Serial.println(zero,DEC);
Serial.println(one,DEC);
Serial.println(two,DEC);
Serial.println(three,DEC);
Serial.println(four,DEC);
Serial.println(five,DEC);
Serial.println(six,DEC);
Serial.println(seven,DEC);
Serial.println(eight,DEC);
Serial.println(nine,DEC);
Serial.println();
Serial.println();
Serial.println(zero,HEX);
Serial.println(one,HEX);
Serial.println(two,HEX);
Serial.println(three,HEX);
Serial.println(four,HEX);
Serial.println(five,HEX);
Serial.println(six,HEX);
Serial.println(seven,HEX);
Serial.println(eight,HEX);
Serial.println(nine,HEX);
Serial.println();
Serial.println();
//*/
/*
digitalWrite(latchPin1, LOW);
shiftOut(dataPin1, clockPin1, LSBFIRST, 190);
digitalWrite(latchPin1, HIGH);
*/
/*
for(int i = 0; i<10; i++)
{
//Serial.println(DecimalCodes[i]);
digitalWrite(latchPin1, LOW);
shiftOut(dataPin1, clockPin1, LSBFIRST, DecimalCodes[i]);
//shiftOut(dataPin1, clockPin1, LSBFIRST, DecimalCodes[i]);
digitalWrite(latchPin1, HIGH);
delay(1500);
} */
}
void loop() {
//pattern = ~pattern; // Invert the pattern
}
void SSDdisplay( int digitCode)//decimal code
{
digitalWrite(latchPin1, LOW);
shiftOut(dataPin1, clockPin1, LSBFIRST, digitCode);
digitalWrite(latchPin1, HIGH);
}