1

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?

5
  • the wrong segment is being lit probably .... unplug wires one at a time to figure out which one is causing the problem Commented Feb 9, 2020 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. Commented Feb 9, 2020 at 4:26
  • 1
    you may have more than one pair of segments interchanged ... the picture shows segments d and e interchanged Commented Feb 9, 2020 at 4:30
  • It's a binary display: only shows zeros and ones. Commented Feb 9, 2020 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. Commented Feb 9, 2020 at 10:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.