| using streamming for arduino lcd shield Steaming make power full and convenient to display text on lcd. BL-TFT240302PLUS libraey provide streaming for display text.
.jpg)
Function
Display text on LCD using normal font class. To display number in any format. It must convert number to string before display.
char sTemp[10];
LCD.Reset();
LCD.Clear(BLACK);
LCD.Font(f20x19);
LCD.FgColor = GREEN; // text foreground color
LCD.BkColor = BLACK; // text background color
LCD.Puts("BL-TFT240320PLUS\n");
LCD.cursorX = 10;
LCD.cursorY = 100;
LCD.Puts("www.circuitidea.com\n");
LCD.FgColor = GREEN; // text foreground color
LCD.BkColor = RED; // text background color
ltoa(100, sTemp, 10); // convert long to string
LCD.Puts(sTemp);
itoa(100, sTemp, 10); // convert integer to string
LCD.Puts(sTemp);
Streaming
Example code show how easy to display text. Set color, set cursor, print text and print number in many format. Before using streaming, It must be include "Streaming.h".
#include <Streaming.h>
LCD.Reset();
LCD.Font(f20x19);
LCD << "BL-TFT240320PLUS\n";
LCD << _TextColor(GREEN, BLACK) <<"www.circuitidea.com\n";
LCD << _TextColor(_RGB(255,255,0), BLACK) << "Streamming is power full\n\n" ;
LCD.println(12345, HEX);
LCD.println(12345, BIN);
LCD.write("hello world\n");
LCD.write(sText, 3);
LCD.println();
LCD << _TextColor(CYAN, BLACK) << "hex" << _HEX(1234567) << "\n";
LCD << _TextColor(GREEN, BLACK) << "oct" << _OCT(1234567) << "\n";
LCD << _TextColor(GOLD, BLACK) << "bin" << _BIN(1234567) << "\n";
LCD << _TextColor(YELLOW, BLACK) << "dex" << _DEC(1234567) << "\n";
LCD << _TextColor(MAGENTA, BLACK) << "float" << 12.34567 << "\n";
LCD << _Cursor(10,250) << "set cursor and print";
LCD << _Cursor(0,270) << _TextColor(RED, BLACK) << "set cursor,";
LCD << _TextColor(YELLOW, BLACK) << "color ";
LCD << _TextColor(GREEN, BLACK) << "and print";
Download
library and example source code www.circuitidea.com/dev-board/BL-TFT240320PLUS-V2.html
|