Skip to content

Commit

Permalink
update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
RobTillaart committed Nov 22, 2023
1 parent dafc549 commit a385863
Showing 1 changed file with 37 additions and 10 deletions.
47 changes: 37 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,26 @@ ESP32 is supported since 0.2.0 see https://github.com/RobTillaart/TM1637_RT/pull
- https://docs.wokwi.com/parts/wokwi-tm1637-7segment#simulator-examples


#### Hardware connection and performance

From tests of SteveMicroCode (See #29) it became clear that the proposed hardware in the
datasheet is very robust but slow. See page 8 datasheet.
Leaving out the 100 pF capacitors on the CLK and DIO line, or dimension them smaller,
allows for faster communication and thus more efficient CPU use.

Additional tests of wfdudley (See Keyboard Scanner section) shows that reducing
the pull up resistor from 10 KΩ to 1000 Ω improves the signal quality.
This too allows for faster communication and efficient CPU use.

Datasheet page 3: _and the clock frequency should be less than 250K_ (KHz)
This implies that the **setBitDelay()** could be set much lower than the default 10 micro
seconds of the library. On "slower" platforms it might even be 0.
However it is always important to do your own tests if you want to tweak performance
beyond the specifications of the datasheet.
Interference from other electronic components is often nearby, and if you need longer
cables consider shielded ones.

Note: Ω = ALT-234


## Interface
Expand Down Expand Up @@ -84,6 +104,10 @@ Applications include:
- meters + centimetre MM:CC (e.g distance sensor)
- feet + inches FF:II
- any pair of integers (-9 .. 99) side by side.


#### Display functions III

- **void displayCelsius(int temp, bool colon = false)** print temperature in **Celsius** format.
The function allows a range from -9 .. 99 + °C.
The colon is default false.
Expand All @@ -99,16 +123,19 @@ Colon can be used e.g. to indicate under- or overflow, or any other threshold.
TM.displayCelsius(temperature, (temperature < -9) || (temperature > 99));
```

##### Notes on temperature
Note that the effective range of Celsius and Fahrenheit differs.
When Fahrenheit goes from -9 to 99 Celsius goes from -26 to 37 (etc).

Note that the effective range of C and F differs
| F | C | F | C |
|:-----:|:-----:|:-----:|:-----:|
| -9 | -26 | 16 | -9 |
| 99 | 37 | 210 | 99 |
| F | C | | F | C |
|:-----:|:-----:|:----:|:-----:|:-----:|
| -9 | -26 | | 16 | -9 |
| 99 | 37 | | 210 | 99 |

Need to think about a 3 digit temperature to extend the range -99 .. 999
or to have one decimal.
A three digit temperature, e.g. range -99 .. 999, would be possible but one has
to leave out either the ° character or the C/F.
As the C/F is more informative, the choice is fairly easy.
Question is how to API should change, new function of new behaviour?
See future.


#### Brightness
Expand Down Expand Up @@ -209,11 +236,11 @@ when the library is used with an ESP32. The function called there **nanoDelay(n)
needs manual adjustment depending upon processor frequency and time needed for a digitalWrite.
Feel free to file an issue to get your processor supported.

----

## Keyboard Scanner usage and notes

- Kudos to wfdudley for this section - See #11
-

Calling **keyscan()** returns a uint8_t, whose value is 0xff if no keys are being pressed at the time.
The TM1637 can only see one key press at a time, and there is no "rollover".
Expand Down Expand Up @@ -328,7 +355,7 @@ See examples

- testing other platforms.
- refactor readme.md
- remove degree sign from **displayCelsius()** ?
- remove degree sign from **displayCelsius()**
- would allow one extra digit.
- **displayFahrenheit()** idem.
- could be optional when needed e.g. below -9 or above 99
Expand Down

0 comments on commit a385863

Please sign in to comment.