Use current set of font, color, draw mode, direction, alignment to draw text or character on the current position on the draw window(default is full screen).
If the character's position is over the defined Draw Window, then the cursor move to the next character line at left.
Note1: This command terminated by a byte of value 0
Note2: Use LF ("\n", value=10) can move cursor to next text line, and CR ("\r", value=13) can move cursor to the most left position. So LF+CR can move cursor to the next new at left.
Direct: |
"TTchars\x00" print the chars on the screen |
Arduino: |
void drawStr(unsigned int x, unsigned int y, const char *s) void print(const String &s) void print(const char v[]) void print(char v) void print(unsigned char v, int base = 10) void print(int v, int base = 10) void print(unsigned int v, int base = 10) void print(long v, int base = 10) void print(unsigned long v, int base = 10) void print(double v, int base = 2) Use println instead of print will also move cursor to next character line at left |
C: |
void Digole_drawStr(unsigned int x, unsigned int y, const char *s) |
x, y
The position of text (Not pixel position), it's based on the width and height of current font.
s, v
The value or string or character array want to be printed.
base
Can print the value on differect base, eg: BIN(binarry), OCT(Octal), DEC(Decimal), HEX(hex).
none
int v=64;
mydisp.drawStr(4,5,"Hello World!"); //display "Hello World!" on the screen
mydisp.print(v); //display: 64
mydisp.print(v,BIN); //display:1000000
serial.writeString("TTHello World!\x00"); //show "Hello World!" on the screen
Version | Description |
---|---|