0

The SevSeg library by Dean Reading seems to have a keyword to control individual segments on SSD's. I am using four common cathode, single digit displays. Does anyone know how to program individual segments?

#include "SevSeg.h"; 
SevSeg sevseg; 
void setup() {
 // put your setup code here, to run once:
 byte numDigits = 4;
 byte digitPins[] = {2, 3, 4, 5};
 byte segmentPins[] = {6, 7, 8, 9, 10, 11, 12, 13};
 bool resistorsOnSegments = false; // 'false' means resistors are on digit pins
 byte hardwareConfig = COMMON_CATHODE; // See README.md for options
 bool updateWithDelays = false; // Default 'false' is Recommended
 bool leadingZeros = false; // Use 'true' if you'd like to keep the leading zeros
 bool disableDecPoint = false; // Use 'true' if your decimal point doesn't exist or isn't connected. Then, you only need to specify 7 segmentPins[]
 sevseg.begin(hardwareConfig, numDigits, digitPins, segmentPins, 
 resistorsOnSegments,
 updateWithDelays, leadingZeros, disableDecPoint);
}
void loop() {
 // put your main code here, to run repeatedly:
 sevseg.setSegments();
 //sevseg.setNumber(1234,0);
 //sevseg.setChars("");
 //sevseg.blank();
 sevseg.refreshDisplay();
}
asked Jan 17, 2020 at 21:49
5
  • why did you not put a parameter into the setSegments() function call? Commented Jan 17, 2020 at 22:14
  • Because i don't yet know what parameter to put, or how to use the function. Commented Jan 17, 2020 at 22:15
  • tried that. displays a bunch of gibberish. Commented Jan 17, 2020 at 22:20
  • It is always the same if you just enter 1, or 2, or 25 etc.. I don't think that's how the function works. Displaying numbers with the setNumber function works perfectly however, so my displays are wired correctly. Commented Jan 17, 2020 at 22:24
  • what is unclear here github.com/DeanIsMe/SevSeg/blob/… Commented Jan 18, 2020 at 19:17

1 Answer 1

0

You can't with that library. The author has not provided any public methods that will do the job.

There are private methods (segmentOn and segmentOff) that might be usable, but you would have to modify the library to be able to access them.

answered Jan 17, 2020 at 22:13
9
  • Are 4 and 2 just arbitrary numbers you chose? Commented Jan 17, 2020 at 22:19
  • Yes. They are the segment number you want to turn on or off. Commented Jan 17, 2020 at 22:25
  • How would you specify which digit? Commented Jan 17, 2020 at 22:31
  • Probably with different numbers. Experiment and find out. Commented Jan 17, 2020 at 22:43
  • Last question.. Where should those functions be placed within the code? I'm getting "private within this context". Commented Jan 17, 2020 at 23:03

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.