2

I am using the following TM1637 board with an Arduino Pro Micro clone.

I am attempting to use the "TM1637Display Library" written by Avishay Orpaz, but I cannot find any way to use the four decimal points on this display (as opposed to the colon appearing on many 4 digit displays). Is there any way to use this driver to output one of the decimal points to the display? If not, what is a 1637 driver which will allow me to output a decimal point? I am going to be reading the voltages on several of the Arduino analog inputs and outputting them to the display in sequence.

Juraj
  • 18,264
  • 4
  • 31
  • 49
LesRhorer
  • 115
  • 8

2 Answers2

1

I found this (edited for relevance)

#include <Arduino.h>
#include <TM1637Display.h>

// Module connection pins (Digital Pins) #define CLK 4 #define DIO 3

// Create a new instance of the TM1637Display class TM1637Display display(CLK, DIO);

// The amount of time (in milliseconds) between tests #define TEST_DELAY 2000

void setup() {};

void loop() { int k; uint8_t data[] = { 0xff, 0xff, 0xff, 0xff }; // Create an array that turns all segments ON uint8_t blank[] = { 0x00, 0x00, 0x00, 0x00 }; // Create an array that turns all segments OFF display.setBrightness(0x0f);

// All segments on display.setSegments(data); delay(TEST_DELAY);

// Run through all the dots
for(k=0; k &lt;= 4; k++) {
    display.showNumberDecEx(0, (0x80 &gt;&gt; k), true);
    delay(TEST_DELAY);
}

}

LesRhorer
  • 115
  • 8
0

The example of Avishay Orpaz's TM1637Display library has this:

// Run through all the dots
for(k=0; k <= 4; k++) {
  display.showNumberDecEx(0, (0x80 >> k), true);
  delay(TEST_DELAY); // show the dot
}

If you use display.setSegments and encode the segments in the sketch, the dot is the 8 bit in the byte encoding the segments of the digit.

displayData[i] = display.encodeDigit(digit[i])
displayData[i] |= 0x80; // show the dot
Juraj
  • 18,264
  • 4
  • 31
  • 49