Skip to content
Anatoli Arkhipenko edited this page Dec 4, 2017 · 15 revisions

Constructor

TM1650(unsigned int aNumDigits = 4);

Usage:

Creates an object to control the behavior of physical JCY device.

Parameters:

  • aNumDigits - Number of digits on the physical device.
    Default: 4
    Min: 1
    Max: 16

Initialization methods

void	init();
void	clear();

Usage:

Init initializes the TM1650 objects to the state right after construction.
Clear clears the screen of TM1650 device.

Parameters:

  • None
    Default: n/a

Display control methods

void	displayOn();
void	displayOff();

Usage:

Turns the 7 segment display on and off respectively.

Parameters:

  • None
    Default: n/a

void	displayState(bool aState);

Usage:

Turns the 7 segment display on and off depending on the value of aState variable. On if TRUE, and off if FALSE.

Parameters:

  • aState - state of the 7 segment display
    Default: n/a

void	displayString(char *aString);

Usage:

Displays the contents of a character array aString on the 7 segment display. Only the leading characters up to the max number of characters are displayed.
NOTE: Some characters are impossible to properly display using 7 segments (e.g. "W"). Those characters are not displayed at all (black space).
NOTE: If you would like to display a dot next to a specific character, that character code needs to be OR-ed with 0x80 (0b10000000).

Parameters:

  • aString - A string variable containing desired text to be displayed.
    Default: n/a

int 	displayRunning(char *aString);

Usage:

Displays the initial contents of a character array aString on the 7 segment display before initiating shifting of the text the the left. Only the leading characters up to the max number of characters are displayed initially.
Call to displayRunning() method should be followed by repetitive calls of displayRunningShift() method until the entire string has been displayed.

Parameters:

  • aString - A string variable containing desired text to be displayed.
    Default: n/a
    Returns: integer number of positions left to be displayed.

int 	displayRunningShift();

Usage:

Shifts a string initially displayed by displayRunning() method one position to the left.
Call displayRunningShift() method until the entire string has been displayed.

Parameters:

  • n/a
    Default: n/a
    Returns: integer number of positions left to be displayed.
snprintf( line, 54, "date %04d-%02d-%02d %02d%02d", year(tnow), month(tnow), day(tnow), hour(tnow), minute(tnow) );
line[17] |= 0b10000000;  //dot
panel.displayRunning(line); delay(RUNNING_DISPLAY_START_DELAY);
while (panel.displayRunningShift()) delay(RUNNING_DISPLAY_DELAY);
delay(2000);  

Brightness control

void	setBrightness(unsigned int aValue = TM1650_MAX_BRIGHT);
void	setBrightnessGradually(unsigned int aValue = TM1650_MAX_BRIGHT);

Usage:

Sets brightness of the entire panel either immediately or gradually (over a period of ~1/2 second).

Parameters:

  • aValue - Brightness intensity
    Default: TM1650_MAX_BRIGHT
    Min: TM1650_MIN_BRIGHT
    Max: TM1650_MAX_BRIGHT
    Returns: integer number of positions left to be displayed.

inline unsigned int getBrightness() { return iBrightness; };

Usage:

Return current panel brightness.

Parameters:

  • n/a
    Default: n/a
    Returns: integer current panel brightness.

Direct individual display positions control

void	controlPosition(unsigned int aPos, byte aValue);

Usage:

Directly write to the CONTROL register of the digital position.

Parameters:

  • aPos = position to set the control register for
  • aValue = value to write to the position Default: n/a

void	setPosition(unsigned int aPos, byte aValue);

Usage:

Directly write to the digit register of the digital position.

Parameters:

  • aPos = position to set the control register for
  • aValue = value to write to the position Default: n/a

void	setDot(unsigned int aPos, bool aState);

Usage:

Directly set/clear a 'dot' next to a specific position.

Parameters:

  • aPos = position to set the control register for
  • aValue = value to write to the position Default: n/a

byte	getPosition(unsigned int aPos);

Usage:

Returns digit currently displayed at a specific digital position.

Parameters:

  • aPos = position to read the digit buffer for Default: n/a
    Returns: a character code currently displayed at a given position

inline unsigned int	getNumPositions() { return iNumDigits; };