So I spent a bit trying to figure the wiring and I THOUGHT I had it working but something interesting happened. Displaying works for only the numbers 1, 3, 4, 7, 8, and 9, but are weird when it comes to the numbers 2, 5, 6. I am unsure why this is happening and tbh I am pretty new to arduino.
Here is the code:
#include "SevSeg.h"
SevSeg sevseg; //Initiate a seven segment controller object
void setup() {
byte numDigits = 4;
byte digitPins[] = {2, 3, 4, 5};
byte segmentPins[] = {6, 7, 8, 9, 10, 11, 12, 13};
sevseg.begin(COMMON_CATHODE, numDigits, digitPins, segmentPins);
sevseg.setBrightness(60);
}
int timer = 1000;
void loop() {
sevseg.setNumber(2222);
sevseg.refreshDisplay(); // Must run repeatedly
}
Any ideas on how this might be happening?
d
ande
interchanged – jsotola Feb 9 '20 at 4:30b
andc
are interchanged. This might explain why 0, 1, 3, 4, 7, 8, and 9 look correct, because they have both segments on. 2, 5, and 6 need only one of both on. – the busybee Feb 9 '20 at 10:23