Greetings!
I discovered the NoiascaHt16k33 library.
I use Noiasca_ht16k33_hw_7 to control 8 Digit seven segment LED display.
It seems that this is one of the few lines or perhaps the only one (it's the only one I've discovered) that can control 8 digits connected to an HT16K33 backpack.
I'm using the eight digit display for a timecounter.
The timecounter counts rising edge pulses received from outside (I don't need any clock generator).
I would like the format shown in the display to be the following: 22.22.22.22
Obviously the numbers I wrote are random, but, instead, the dot points that serve as simple separators are very important.
Well, I can't print dot points,
I don't understand the syntax I have to use.
The dot points must be fixed and always lit, they are not floating commas, they are simple dots that act as a visual separator.
The main problem is that every single digit is the result of an independent calculation. therefore, even more so, I don't know how to do it because if I insert a "point" in the calculation, obviously I get an error from the Arduino IDE.
I'm not yet good at using Arrays (assuming they can be a help for this problem of mine).
It was also kindly suggested that I could use sprintf,
but I've read that it's a bit resource-intensive.
The pulses to read are around 40 per second and I don't know if sprintf can do it, also because the Loop of my code is quite long
...and in any case i have trouble to use sprintf
because I'm not yet very familiar with it and it's complicated for me to apply it without real code input. I'm sorry, I'm worse than a child. I'm still too used to CMOS logic gates and have a lot to learn in C++
This was suggested to me:
print value A and print the dot
print value B and print the dot
print value C and print the dot
print value D
but I don't know the syntax,
The calculations in my sketch are classic, of this type:
(I used easier to understand names for the example)
void Count() {
Digit1 = ((pulseNumber % pulseRate) % 10);
Digit2 = (((pulseNumber % pulseRate) / 10) % 10);
Digit3 = (((pulseNumber / pulseRate) % 60) % 10);
Digit4 = ((((pulseNumber / pulseRate) % 60) / 10) % 10);
Digit5 = ((((pulseNumber / pulseRate) / 60) % 60) % 10);
Digit6 = (((((pulseNumber / pulseRate) / 60) % 60) / 10) % 10);
Digit7 = (((((pulseNumber / pulseRate) / 60) / 60) % 10) % 10);
Digit8 = ((((((pulseNumber / pulseRate) / 60) / 60) / 10) % 10) % 10);
/*
to this we add that to exploit the Leading of the Zeros
and the shift of the minus sign (thanks Noiasca!)
I had to recompose the individual digits again with
a classic workaround, that is:
*/
// Workaround for composing timeNumber digits
timeNumber = ((Digit8 * 10000000) + (Digit7 * 1000000) + (Digit6 * 100000) + (Digit5 * 10000) + (Digit4 * 1000) + (Digit3 * 100) + (Digit2 * 10) + Digit1);
} // close void Count
So, where and how do I insert dot points?
Thanks for the attention.
I hope for help that could be very interesting for anyone.