You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
711 B
28 lines
711 B
6 years ago
|
/*
|
||
|
* Simple code to test the display function and electrical connections.
|
||
|
*/
|
||
|
#include <SevSeg.h>
|
||
|
|
||
|
//Instantiates a seven segment object
|
||
|
SevSeg sevseg;
|
||
|
|
||
|
void setup() {
|
||
|
byte numDigits = 4;
|
||
|
byte digitPins[] = {14, 17, 18, 12};
|
||
|
byte segmentPins[] = {15, 19, 7, 9, 6, 16, 8};
|
||
|
bool resistorsOnSegments = false;
|
||
|
byte hardwareConfig = COMMON_CATHODE;
|
||
|
bool updateWithDelays = false;
|
||
|
bool leadingZeros = false;
|
||
|
bool disableDecPoint = true;
|
||
|
|
||
|
sevseg.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments,
|
||
|
updateWithDelays, leadingZeros, disableDecPoint);
|
||
|
}
|
||
|
|
||
|
void loop() {
|
||
|
sevseg.setNumber(555,0); // Displays '3.141'
|
||
|
sevseg.refreshDisplay();
|
||
|
sevseg.setBrightness(100);
|
||
|
}
|