public class Display
extends java.lang.Object
Constructor and Description |
---|
Display()
Creates a display instance.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Turns all digits off.
|
void |
clearDigit(int digit)
Clears the given digit
|
java.lang.String |
getDisplayableChars()
Returns a string with all displayable characters.
|
boolean |
isTickerAlive()
Checks, if the ticker is still displaying.
|
int |
scrollToLeft()
Scrolls the scrollable text one step to the left.
|
int |
scrollToRight()
Scrolls the scrollable text one step to the right.
|
void |
setBinary(byte value,
int digit)
Shows the pattern of the binary value 0..255.
|
void |
setDecimalPoint(int id)
Shows one of the 3 decimal points.
|
void |
setDigit(char ch,
int digit)
Shows the given character at one of the 4 7-segment digits.
|
void |
setScrollableText(java.lang.String text)
Same as setScrollableText(text, pos) with pos = 0 (text starts at leftmost digit).
|
void |
setScrollableText(java.lang.String text,
int pos)
Displays a text that can be scrolled.
|
void |
setText(int value)
Same as setText(text) with integer parameter.
|
void |
setText(int value,
int[] dp)
Same as setText(text, dp) with integer parameter.
|
void |
setText(java.lang.String text)
Same as setText(text, dp) with dp = [0, 0, 0] (no decimal point).
|
void |
setText(java.lang.String text,
int[] dp)
Displays the given text right justified by multiplexing using a display thread.
|
void |
setToStart()
Shows the scrollable text at the start position.
|
void |
stopTicker()
Stops a running ticker.
|
void |
ticker(java.lang.String text)
Same as ticker(text, count, speed, blocking) with count = 1,
speed = 2 and blocking = false.
|
void |
ticker(java.lang.String text,
int count)
Same as ticker(text, count, speed, blocking) with speed = 2 and blocking = false.
|
void |
ticker(java.lang.String text,
int count,
int speed)
Same as ticker(text, count, speed, blocking) with blocking = false.
|
void |
ticker(java.lang.String text,
int count,
int speed,
boolean blocking)
Shows a ticker text that scroll to left until the last 4 characters are displayed.
|
public void setDigit(char ch, int digit)
ch
- the character to displaydigit
- the display ID (0 is leftmost, 3 is rightmost)public void setBinary(byte value, int digit)
value
- the byte valuedigit
- the display ID (0 is leftmost, 3 is rightmostpublic void setDecimalPoint(int id)
id
- select the DP to show:public void clearDigit(int digit)
digit
- the display ID (0 is right most, 3 is left most)public void clear()
public void setText(java.lang.String text, int[] dp)
text
- the text to displaydp
- a int array if size 3 with 1 or 0, if the decimal
point is shown or notpublic void setText(int value, int[] dp)
value
- the value to display (first 4 digits)dp
- a int array if size 3 with 1 or 0, if the decimal
point is shown or notpublic void setText(java.lang.String text)
text
- the text to displaypublic void setText(int value)
value
- the value to display (first 4 digits)public void setScrollableText(java.lang.String text, int pos)
text
- the text to displaypos
- the start value of the text pointer (character index positioned a leftmost digit)public void setScrollableText(java.lang.String text)
text
- the text to displaypublic int scrollToLeft()
public int scrollToRight()
public void setToStart()
public void ticker(java.lang.String text, int count, int speed, boolean blocking)
text
- the text to display, if shorter than 4 characters, scrolling is disabledcount
- the number of repetitions (default: 1). For count == 0, infinite duration,
stopped by calling stopTicker()speed
- the speed number of scrolling operations per sec (default: 2)blocking
- if True, the method blocks until the ticker has finished; otherwise
it returns immediately (default: False)public void ticker(java.lang.String text, int count, int speed)
text
- the text to display, if shorter than 4 characters, scrolling is disabledcount
- the number of repetitions (default: 1). For count == 0, infinite duration,
stopped by calling stopTicker()speed
- the speed number of scrolling operations per sec (default: 2)public void ticker(java.lang.String text, int count)
text
- the text to display, if shorter than 4 characters, scrolling is disabledcount
- the number of repetitions (default: 1). For count == 0, infinite duration,
stopped by calling stopTicker()public void ticker(java.lang.String text)
text
- the text to display, if shorter than 4 characters, scrolling is disabledpublic void stopTicker()
public boolean isTickerAlive()
public java.lang.String getDisplayableChars()