2 digits 7 segment display

yes, I just want to write 1, 0 on display, nothing more.

does this work?

#include <SevSeg.h>

SevSeg myDisplay;
unsigned long timer;
int deciSecond = 0;

void setup()
{

int displayType = COMMON_CATHODE;
int digit1 = 14;
int digit2 = 15;
int digit3 = 0;
int digit4 = 0;
int segA = 2;
int segB = 3;
int segC = 4;
int segD = 5;
int segE = 6;
int segF = 7;
int segG = 8;
int segDP= 9;

int numberOfDigits = 2;
myDisplay.Begin(displayType, numberOfDigits, digit1, digit2, digit3, digit4, segA, segB, segC, segD, segE, segF, segG, segDP);
myDisplay.SetBrightness(100);

timer = millis();
 
 myDisplay.DisplayString("10", 0);  // attempt to write "10" to the display
  
}

void loop()
{

}

no, it shows nothing

The example you posted was truncated.
It is from SevSeg/SevSeg_Counter.ino at master · DeanIsMe/SevSeg · GitHub or similar.

Put this in the loop:

myDisplay.refreshDisplay(); // Must run repeatedly

This version looks even closer and does not use the refrehDisplay() method:

Yeah, error messages don't get much clearer than that.

There are a number of libraries called SevSeg with slightly different interfaces.
Maybe you have more success with this (untested) :

#include <SevSeg.h>

SevSeg myDisplay;
unsigned long timer;
int deciSecond = 0;

void setup()
{

  int displayType = COMMON_CATHODE;
  int digit1 = 14;
  int digit2 = 15;
  int digit3 = 0;
  int digit4 = 0;
  int segA = 2;
  int segB = 3;
  int segC = 4;
  int segD = 5;
  int segE = 6;
  int segF = 7;
  int segG = 8;
  int segDP = 9;

  int numberOfDigits = 2;
  myDisplay.Begin(displayType, numberOfDigits, digit1, digit2, digit3, digit4, segA, segB, segC, segD, segE, segF, segG, segDP);
  myDisplay.SetBrightness(100);

  timer = millis();
}

void loop()
{
  myDisplay.DisplayString("10", 0);  // attempt to write "10" to the display
  delay(5) ;
}

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.