Hey!
I would appreciate help with the following code. I am trying to display a certain calculation on the display of the TM1637 4-digit 7-segment LED display module (not so relevant for the purpose of the calculation and what I want to display) but I am unable to put a period after the first digit on the left. I would appreciate it if you could help me put a point.
Attach a picture of the result on the monitor. In the following picture, for example, I want to permanently put a dot in such a way that it looks like this: 5.30 How do I do it?
Unfortunately, there are numerous TM1637 libraries all with the same name. So please post a link to the library that you used, so we can suggest functions that might do what you ask.
The problem may be the display. I've had two where only the colon functioned, not the dp. So displaying time was easy, floating point not so much.
There may be a segment test option in the library you're using, if so use it - it should light all possible display segments. If the dp doesn't show with that, you're wasting your time.
There are many ways to do this. Really, this program bypasses all the useful routines that are provided by the library (which you could see by looking there). So using the library's dot control may not be intuitive.
You could either re-write the program using 'showNumberDec' which gives you control of the decimals, or you could just do something cheesy like
textio is a string and in the string the second index - [1] is the dot.. If I display all the indexes of the string I get an incorrect display and the dot is not displayed so I had to skip it.
Could you please show me a sample line of code that could be used as a replacement for the program I attached? In my program I am trying to display the measurement result of a real value of battery voltage with a load by connecting it to the Arduino (through an analog pin) I am interested in displaying the voltage value obtained from the measurement on the screen.
Oh, that's a separate problem. Then you have to break out the number as an integer, identify the decimal point location and then write the integer and the decimal together. I've seen ONE library that gets it right, if it encounters a DP in the print stream it will bundle it with the current digit instead of allocating a blank digit to only display a DP. But I can't remember which library. You might have to do it all manually. I assumed you have a fixed decimal point with a fixed number of digits, e.g. "0.00" to "5.00" for example. But I could be wrong. If so then there is more monkeying around to do.