Created
August 12, 2016 16:26
-
-
Save drews256/bed411108366766d6ab04ab836539754 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define data 2 | |
#define clock 3 | |
// use binary notation to discribe our number layouts | |
byte zero = B01111110; | |
byte one = B00000110; | |
byte two = B11011010; | |
byte three = B11010110; | |
byte four = B10100110; | |
byte five = B11110100; | |
byte six = B11111100; | |
byte seven = B01000110; | |
byte eight = B11111110; | |
byte nine = B11110110; | |
void setup() | |
{ | |
pinMode(clock, OUTPUT); // make the clock pin an output | |
pinMode(data , OUTPUT); // make the data pin an output3 | |
} | |
void loop() | |
{ | |
shiftOut(data, clock, LSBFIRST, zero); | |
delay(500); | |
shiftOut(data, clock, LSBFIRST, one); | |
delay(500); | |
shiftOut(data, clock, LSBFIRST, two); | |
delay(500); | |
shiftOut(data, clock, LSBFIRST, three); | |
delay(500); | |
shiftOut(data, clock, LSBFIRST, four); | |
delay(500); | |
shiftOut(data, clock, LSBFIRST, five); | |
delay(500); | |
shiftOut(data, clock, LSBFIRST, six); | |
delay(500); | |
shiftOut(data, clock, LSBFIRST, seven); | |
delay(500); | |
shiftOut(data, clock, LSBFIRST, eight); | |
delay(500); | |
shiftOut(data, clock, LSBFIRST, nine); | |
delay(500); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment