Mcufriend 2.4" LCD TFT Console Library


hello arduino users! first topic here on arduino (perhaps i've been playing arduinos years).
recently have written library acts "wrapper", "interface" or whatever modified version of adafruit libary (for lcd tft screens).
first of all, many "mole android" providing library. (in fact, bought screen half year ago, , now, finally, working). links original sources of library @ bottom.




tft console library

beware! since library in "beta", there many functions act fake placeholders , may not cause effect. even, if change font size, can cause not show correctly text.

so, library itself provides class called tftconsole, ready use mcufriend 2.4'' lcd tft screen.

the use simple: create tftconsole object, , use console output, if were using serial comunication.

below there's example of simplest use:
code: [select]

#include "tftconsole.h"

//console acts bridge between , tft library.
tftconsole cout;


void setup() {
  // put setup code here, run once:
  serial.begin(9600);
  cout.init();

  cout.println("hello world!");
}

int count = 0;
void loop() {
  // put main code here, run repeatedly:

}


edit:
here's example serial com.
with example program can send single lines of text screen directly serial monitor
code: [select]

#include "tftconsole.h"

//console acts bridge between , tft library.
tftconsole cout;

 
void setup() {
  // put setup code here, run once:
  serial.begin(9600);
  cout.init();
}

int serialdata = 0;

string finale = "";

bool printing = false;

void loop() {
  // put main code here, run repeatedly:
  if (serial.available() > 0)
  {
    serialdata = serial.read();
    if (serialdata == 10){
      printing = true;
    } else {
      finale += (char)serialdata;
    }
  }
  if (printing) {
    cout.println(finale);
    finale = "";
    printing = false;
  }
}

here's link bitbucket wiki (for syntax highlighting):
go bitbucket!

remember change line feeding "new line"!!


as can see, cout.println("some text"); acts serial.println("whatever");




the source in bitbucket (is github):
go source code page

a zip containing library ready use:
download library

installation: drop folder inside .zip file in "documents/arduino/libraries/".
remember include tftconsole.h




links original source of libraries have used there:
youtube video source
the download source



Arduino Forum > Using Arduino > Displays > Mcufriend 2.4" LCD TFT Console Library


arduino

Comments