I have a TM1637 module and try to display the colon but without succes.
An ATtiny85 reads out two different NTC thermistors.
I would like the display to show 0 or 1 ( to know which temp is shown), then an empty space or an H when a temp goes over an upper limit, then the temperature as an int.
When the temp is too high I would like the display to show the number of the thermistor, the H and the colon and the temperature ie.
0__32 for temp 0, _ = a space character
1H:60 for temp 1
The library I use is the TM1637Display library which can be downloaded from the IDE of Arduino.
The temp number and temperature are not the problem, that works. The H when a temp is too high works as well. But it seems impossible to add the colon with the H.
You need to set the MSB (most significant bit) of the character pattern to 1 to display the colon (this will only work when the character is on the 2nd LED digit from the left).
The display I have is the one with the colon between 2nd and 3rd LED digit.
Using your code gives r i colon on colon off c c on the display.
As david said that is what the MSB does, 1 shows colon, 0 hides it, it is the difference between 0b10000000 and 0b0000000 on the 2nd digit in my case.
Now it is showing for example 1H:73 as of temp sensor 1 senses a temperature that is higher as the set max temp and adds H: to the display.
It is not impossible to control the dots and colon with this library. Look:
void showNumberDecEx(int num, uint8_t dots = 0, bool leading_zero = false, uint8_t length = 4, uint8_t pos = 0);
//! Display a hexadecimal number, with dot control
//!
//! Display the given argument as a hexadecimal number. The dots between the digits (or colon)
//! can be individually controlled.
//!
//! @param num The number to be shown
//! @param dots Dot/Colon enable. The argument is a bitmask, with each bit corresponding to a dot
//! between the digits (or colon mark, as implemented by each module). i.e.
//! For displays with dots between each digit:
//! * 0.000 (0b10000000)
//! * 00.00 (0b01000000)
//! * 000.0 (0b00100000)
//! * 0.0.0.0 (0b11100000)
//! For displays with just a colon:
//! * 00:00 (0b01000000)
//! For displays with dots and colons colon:
//! * 0.0:0.0 (0b11100000)
There just is not a lot of documentation for setting the dots or colon when using a user-defined character. The library has definitions for the LED segments, SEG_A through SEG_G, but nothing is pre-defined for the dot or colon, and the availability of the dot and/or colon is dependent on the specific display.
I know. But at least there is a mechanism to do it. Other libraries for the TM1637 also don't support specific display implementations. Not at that level of detail, at least.
It's better to use the mechanism so you don't have to mingle character and dot operations.
OK, I have not been in a position to find and assemble such a display here just today as I am busy with other things but apparently from your description, the "clock" version of the display has only the colon and no decimal points.