-
Notifications
You must be signed in to change notification settings - Fork 17
TM1650(unsigned int aNumDigits = 4);
Creates an object to control the behavior of physical JCY device.
- aNumDigits - Number of digits on the physical device.
Default: 4
Min: 1
Max: 16
void init();
void clear();
Init initializes the TM1650 objects to the state right after construction.
Clear clears the screen of TM1650 device.
- None
Default: n/a
void displayOn();
void displayOff();
Turns the 7 segment display on and off respectively.
- None
Default: n/a
void displayState(bool aState);
Turns the 7 segment display on and off depending on the value of aState variable. On if TRUE, and off if FALSE.
- aState - state of the 7 segment display
Default: n/a
void displayString(char *aString);
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).
- aString - A string variable containing desired text to be displayed.
Default: n/a
int displayRunning(char *aString);
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.
- aString - A string variable containing desired text to be displayed.
Default: n/a
Returns: integer number of positions left to be displayed.
int displayRunningShift();
Shifts a string initially displayed by displayRunning() method one position to the left.
Call displayRunningShift() method until the entire string has been displayed.
- 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);
void setBrightness(unsigned int aValue = TM1650_MAX_BRIGHT);
void setBrightnessGradually(unsigned int aValue = TM1650_MAX_BRIGHT);
Sets brightness of the entire panel either immediately or gradually (over a period of ~1/2 second).
- 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; };
Return current panel brightness.
- n/a
Default: n/a
Returns: integer current panel brightness.
void controlPosition(unsigned int aPos, byte aValue);
Directly write to the CONTROL register of the digital position.
- 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);
Directly write to the digit register of the digital position.
- 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);
Directly set/clear a 'dot' next to a specific position.
- aPos = position to set the control register for
- aValue = value to write to the position Default: n/a
byte getPosition(unsigned int aPos);
Returns digit currently displayed at a specific digital position.
- 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; };