0

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.

This is how it displays 2222: enter image description here

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?

  • the wrong segment is being lit probably .... unplug wires one at a time to figure out which one is causing the problem – jsotola Feb 9 at 4:10
  • Well one is on that is not supposed to and one that is off when it should be, but the rest of the numbers work which I dont understand. – SaucyCodes05 Feb 9 at 4:26
  • 1
    you may have more than one pair of segments interchanged ... the picture shows segments d and e interchanged – jsotola Feb 9 at 4:30
  • It's a binary display: only shows zeros and ones. – Edgar Bonet Feb 9 at 8:52
  • It seems that segment lines b and c 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 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.