sigvaldm / sevenseg Goto Github PK
View Code? Open in Web Editor NEWArduino 7-segment display library
License: GNU Lesser General Public License v3.0
Arduino 7-segment display library
License: GNU Lesser General Public License v3.0
I understand that you cannot make a universal library where each and every device would work with. (given time and support from community, maybe).
My 4 digit CC 7-seg with AP and Colon has 12 pins.
7 for A-G segment pins (positive supply or GND)
4 for digit 0-digit 3 digit pins (negative supply)
device pin num 3 for AP and COLON (positive, of course)
I have attached a partial diagram to clarify above details. please, mind that rest of the display works fine just as a normal
CC 7-seg display.
after probing through pins, I found out
when digit 2 pin and AP/COLON pin activated, AP lights on
when digit 3 pin and AP/COLON pin activated, COLON lights on
I tried with disp.setColonPin(int colonPin).
disp.setColonPin(3);
I tried with disp.setSymbPins(int digPin, int segUCPin, int segLCPin, int segAPIN).
disp.setSymbPins(9, 3, 3, 3);
both will not turn off colon or AP as CC mode will, in off state, supply correct biasing thus turning LEDs on.
Have I missed something?
Is there any simple work around that I can use to overcome this?
I have read through included pdf guide (SevenSeg.pdf)
write(double) could be refined close to zero. On a four digit display it will now display -0.004 as 0.00 (using only three digits) leaving an open space for minus, and switch to -0.01 for -0.005. This is not incorrect, but consider showing -0.004 as -0.00.
Not all useres like leading zero suppression. Considering making this optional.
disp.write(0.0);
fails on infinite loop.
Hello. I will like to display time (in hours and minutes) on a display but I cant figure out how the code should look. I have managed to display number on it, using the code below, but I have problems displaying time.
Can you please give me an example for how the code should look for displaying time?
#include <SevenSeg.h>
SevenSeg disp(6,7,8,9,10,11,12);
const int numOfDigits=4;
int digitPins[numOfDigits]={2,3,4,5};
void setup() {
disp.setDigitPins(numOfDigits, digitPins);
disp.setCommonCathode();
}
void loop() {
disp.write(1111);
}
https://github.com/espressif/esp-idf/blob/master/components/newlib/include/ctype.h has
#define _C 040
...
#define _B 0200
Changing to something like _b/_c or _PIN_B/_PIN_C solves the issue.
I tried on a Common Cathode single display and didn't worked :D
#include <SevenSeg.h>
SevenSeg disp (0,1,2,3,4,5,6) ;
void setup () {
disp.setCommonCathode();
}
void loop () {
disp.write(5) ;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.