Created
August 29, 2015 03:43
-
-
Save ha1t/642712839126cfd2f331 to your computer and use it in GitHub Desktop.
SevSeg + FlexiTimer2
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 <SevSeg.h> | |
#include <FlexiTimer2.h> | |
SevSeg sevseg; //Instantiate a seven segment object | |
void setup() { | |
byte numDigits = 4; | |
byte digitPins[] = {3, 2, 1, 0}; | |
byte segmentPins[] = {11, 10 ,9 ,8, 7, 6, 5, 4}; | |
//sevseg.begin(COMMON_CATHODE, numDigits, digitPins, segmentPins); | |
sevseg.begin(COMMON_ANODE, numDigits, digitPins, segmentPins); | |
sevseg.setNumber(1000,0); | |
sevseg.setBrightness(5); | |
FlexiTimer2::set(10, flash); | |
FlexiTimer2::start(); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
for (int i = 0; i < 9999; i++) { | |
sevseg.setNumber(i,-1); | |
delay(100); | |
} | |
} | |
void flash() { | |
sevseg.refreshDisplay(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment