Created
June 15, 2015 12:52
-
-
Save gregorykelleher/e976aef02883b979208a 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
#include "LedControl.h" | |
LedControl lc=LedControl(12,11,10,1); | |
void setup(){ | |
Serial.begin(9600); | |
lc.shutdown(0,false); | |
lc.setIntensity(0,10); | |
lc.clearDisplay(0); | |
for(int x =0; x<=9999; x++){ | |
outputNumber(x); | |
delay(125); | |
} | |
} | |
void outputNumber(int counter) | |
{ | |
int nDivider = 10; | |
int digCnt = 0; | |
boolean allDone = false; | |
int queryAns = 0; | |
do { | |
queryAns = counter%nDivider; | |
if(counter==queryAns) allDone=true; | |
lc.setDigit(0, digCnt, queryAns/(nDivider/10), false); | |
digCnt = digCnt + 1; | |
nDivider*=10; | |
} | |
while(!allDone); //false | |
} | |
void loop(){ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment