ILI9163C 128x128 TFT driver

Status
Not open for further replies.
This is why I publish the 'proof of concept' page on my wiki! As you clear see I get 2 display working in the same time on a nano, and without change anithing, the library automatically apply preprocessor variants based on CPU.
I got recently a couple of 128x128 V2.1 RED PCB, Yellow PIN but surprise....not using the ILI9163C but ST7735...
Buzzbombkiirk, In brief, 'I got this, connect to that and don't work, any ideas?' Exposed like this...it's almost impossible
To get help you should provide essential informations as exposed in forum rules like pin used and display connections (all pin) and code used?
What display you have exact? 1.1?, 2.1?
Maybe a picture would help.
I will also suggest to continue this on github pages since is not Teensy related
 
Last edited:
My bad - it is *literally* the stock program, ubnchanged at all (I assume you wrote?) but here is the correct info:

Code I used is the examples like:

Code:
/*
	This example was adapted from ugfx [url]http://ugfx.org[/url]
	It's a great example of many 2d objects in a 3d space (matrix transformations)
	and show the capabilities of RA8875 chip.
 Tested and worked with:
 Teensy3,Teensy3.1,Arduino UNO,Arduino YUN,Arduino Leonardo,Stellaris
 Works with Arduino 1.0.6 IDE, Arduino 1.5.8 IDE, Energia 0013 IDE
*/
#ifdef __AVR__
#define sinf sin
#endif

#include <SPI.h>
#include <TFT_ILI9163C.h>


#define NDOTS 256			// Number of dots 512
#define SCALE 4096 //4096
#define INCREMENT 512//512
#define PI2 6.283185307179586476925286766559
#define RED_COLORS (32)
#define GREEN_COLORS (64)
#define BLUE_COLORS (32)

/*
Teensy3.x and Arduino's
You are using 4 wire SPI here, so:
 MOSI:  11//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site)
 MISO:  12//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site)
 SCK:   13//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site)
ESP8266-----------------------------------
Use:
#define __CS  16  //(D0)
#define __DC  5   //(D1)
#define __RST 4   //(D2)

 SCLK:D5
 MOSI:D7
 */
#define __CS1 	10
#define __DC 	9

#if defined(TFT_ILI9163C_INSTANCES)
TFT_ILI9163C tft = TFT_ILI9163C(REDPCB_NEW, __CS1, __DC);
#else
TFT_ILI9163C tft = TFT_ILI9163C(__CS1, __DC);
#endif

int16_t sine[SCALE+(SCALE/4)];
int16_t *cosi = &sine[SCALE/4];
int16_t angleX = 0, angleY = 0, angleZ = 0;
int16_t speedX = 0, speedY = 0, speedZ = 0;

int16_t xyz[3][NDOTS];
uint16_t col[NDOTS];
int pass = 0;


void initialize (void){
  uint16_t i;
  /* if you change the SCALE*1.25 back to SCALE, the program will
   * occassionally overrun the cosi array -- however this actually
   * produces some interesting effects as the BUBBLES LOSE CONTROL!!!!
   */
  for (i = 0; i < SCALE+(SCALE/4); i++)
    //sine[i] = (-SCALE/2) + (int)(sinf(PI2 * i / SCALE) * sinf(PI2 * i / SCALE) * SCALE);
    sine[i] = (int)(sinf(PI2 * i / SCALE) * SCALE);
}

void setup() 
{
  tft.begin();
  initialize();
}



void matrix (int16_t xyz[3][NDOTS], uint16_t col[NDOTS]){
  static uint32_t t = 0;
  int16_t x = -SCALE, y = -SCALE;
  uint16_t i, s, d;
  uint8_t red,grn,blu;

  for (i = 0; i < NDOTS; i++)
  {
    xyz[0][i] = x;
    xyz[1][i] = y;

    d = sqrt(x * x + y * y); 	/* originally a fastsqrt() call */
    s = sine[(t * 30) % SCALE] + SCALE;

    xyz[2][i] = sine[(d + s) % SCALE] * sine[(t * 10) % SCALE] / SCALE / 2;

    red = (cosi[xyz[2][i] + SCALE / 2] + SCALE) * (RED_COLORS - 1) / SCALE / 2;
    grn = (cosi[(xyz[2][i] + SCALE / 2 + 2 * SCALE / 3) % SCALE] + SCALE) * (GREEN_COLORS - 1) / SCALE / 2;
    blu = (cosi[(xyz[2][i] + SCALE / 2 + SCALE / 3) % SCALE] + SCALE) * (BLUE_COLORS - 1) / SCALE / 2;
    col[i] = ((red << 11) + (grn << 5) + blu);
    x += INCREMENT;
    if (x >= SCALE) x = -SCALE, y += INCREMENT;
  }
  t++;
}

void rotate (int16_t xyz[3][NDOTS], uint16_t angleX, uint16_t angleY, uint16_t angleZ){
  uint16_t i;
  int16_t tmpX, tmpY;
  int16_t sinx = sine[angleX], cosx = cosi[angleX];
  int16_t siny = sine[angleY], cosy = cosi[angleY];
  int16_t sinz = sine[angleZ], cosz = cosi[angleZ];

  for (i = 0; i < NDOTS; i++)
  {
    tmpX      = (xyz[0][i] * cosx - xyz[2][i] * sinx) / SCALE;
    xyz[2][i] = (xyz[0][i] * sinx + xyz[2][i] * cosx) / SCALE;
    xyz[0][i] = tmpX;
    tmpY      = (xyz[1][i] * cosy - xyz[2][i] * siny) / SCALE;
    xyz[2][i] = (xyz[1][i] * siny + xyz[2][i] * cosy) / SCALE;
    xyz[1][i] = tmpY;
    tmpX      = (xyz[0][i] * cosz - xyz[1][i] * sinz) / SCALE;
    xyz[1][i] = (xyz[0][i] * sinz + xyz[1][i] * cosz) / SCALE;
    xyz[0][i] = tmpX;
  }
}


void draw(int16_t xyz[3][NDOTS], uint16_t col[NDOTS]){
  static uint16_t oldProjX[NDOTS] = { 0 };
  static uint16_t oldProjY[NDOTS] = { 0 };
  static uint8_t oldDotSize[NDOTS] = { 0 };
  uint16_t i, projX, projY, projZ, dotSize;

  for (i = 0; i < NDOTS; i++)
  {
    projZ = SCALE - (xyz[2][i] + SCALE) / 4;
    projX = tft.width() / 2 + (xyz[0][i] * projZ / SCALE) / 25;
    projY = tft.height() / 2 + (xyz[1][i] * projZ / SCALE) / 25;
    dotSize = 3 - (xyz[2][i] + SCALE) * 2 / SCALE;

    tft.drawCircle (oldProjX[i], oldProjY[i], oldDotSize[i], BLACK);

    if (projX > dotSize && projY > dotSize && projX < tft.width() - dotSize && projY < tft.height() - dotSize)
    {
      tft.drawCircle (projX, projY, dotSize, col[i]);
      oldProjX[i] = projX;
      oldProjY[i] = projY;
      oldDotSize[i] = dotSize;
    }
  }
}

void loop() 
{
  matrix(xyz, col);
  rotate(xyz, angleX, angleY, angleZ);
  draw(xyz, col);

  angleX += speedX;
  angleY += speedY;
  angleZ += speedZ;

  if (pass > 400) speedY = 1;
  if (pass > 800) speedX = 1;
  if (pass > 1200) speedZ = 1;
  pass++;

  if (angleX >= SCALE) {
    angleX -= SCALE;
  } 
  else if (angleX < 0) {
    angleX += SCALE;
  }

  if (angleY >= SCALE) {
    angleY -= SCALE;
  } 
  else if (angleY < 0) {
    angleY += SCALE;
  }

  if (angleZ >= SCALE) {
    angleZ -= SCALE;
  } 
  else if (angleZ < 0) {
    angleZ += SCALE;
  }
}

Or:
Code:
#include <SPI.h>
#include <TFT_ILI9163C.h>

//uncomment for wireframe
//#define _WIREFRAME
/*
ESP8266-----------------------------------
Use:
#define __CS  16  //(D0)
#define __DC  5   //(D1)
#define __RST 4   //(D2)

 SCLK:D5
 MOSI:D7
 */

#define __CS1 	10
#define __DC 	9

#if defined(TFT_ILI9163C_INSTANCES)
TFT_ILI9163C tft = TFT_ILI9163C(REDPCB_NEW, __CS1, __DC);
#else
TFT_ILI9163C tft = TFT_ILI9163C(__CS1, __DC);
#endif

struct pt3d
{
  int16_t x, y, z;
};

struct surface
{
  uint8_t p[4];
  int16_t z;
};

struct pt2d
{
  int16_t x, y;
  unsigned is_visible;
};


// define a value that corresponds to "1"
#define U 100

// eye to screen distance (fixed)
#define ZS U

// cube edge length is 2*U
struct pt3d cube[8] =
{
  { -U, -U, U},
  { U, -U, U},
  { U, -U, -U},
  { -U, -U, -U},
  { -U, U, U},
  { U, U, U},
  { U, U, -U},
  { -U, U, -U},
};

// define the surfaces
struct surface cube_surface[6] =
{
  { {0, 1, 2, 3}, 0 },	// bottom
  { {4, 5, 6, 7}, 0 },	// top
  { {0, 1, 5, 4}, 0 },	// back

  { {3, 7, 6, 2}, 0 },	// front
  { {1, 2, 6, 5}, 0 },	// right
  { {0, 3, 7, 4}, 0 },	// left
};

// define some structures for the copy of the box, calculation will be done there
struct pt3d cube2[8];
struct pt2d cube_pt[8];

// will contain a rectangle border of the box projection into 2d plane
int16_t x_min, x_max;
int16_t y_min, y_max;

const int16_t sin_tbl[65] = {
  0, 1606, 3196, 4756, 6270, 7723, 9102, 10394, 11585, 12665, 13623, 14449, 15137, 15679, 16069, 16305, 16384, 16305, 16069, 15679,
  15137, 14449, 13623, 12665, 11585, 10394, 9102, 7723, 6270, 4756, 3196, 1606, 0, -1605, -3195, -4755, -6269, -7722, -9101, -10393,
  -11584, -12664, -13622, -14448, -15136, -15678, -16068, -16304, -16383, -16304, -16068, -15678, -15136, -14448, -13622, -12664, -11584, -10393, -9101, -7722,
  -6269, -4755, -3195, -1605, 0
};

const int16_t cos_tbl[65] = {
  16384, 16305, 16069, 15679, 15137, 14449, 13623, 12665, 11585, 10394, 9102, 7723, 6270, 4756, 3196, 1606, 0, -1605, -3195, -4755,
  -6269, -7722, -9101, -10393, -11584, -12664, -13622, -14448, -15136, -15678, -16068, -16304, -16383, -16304, -16068, -15678, -15136, -14448, -13622, -12664,
  -11584, -10393, -9101, -7722, -6269, -4755, -3195, -1605, 0, 1606, 3196, 4756, 6270, 7723, 9102, 10394, 11585, 12665, 13623, 14449,
  15137, 15679, 16069, 16305, 16384
};


void copy_cube(void)
{
  uint8_t i;
  for (i = 0; i < 8; i++)
  {
    cube2[i] = cube[i];
  }
}

void rotate_cube_y(uint16_t w)
{
  uint8_t i;
  int16_t x, z;
  /*
    x' = x * cos(w) + z * sin(w)
    z' = - x * sin(w) + z * cos(w)
  */
  for (i = 0; i < 8; i++)
  {
    x = ((int32_t)cube2[i].x * (int32_t)cos_tbl[w] + (int32_t)cube2[i].z * (int32_t)sin_tbl[w]) >> 14;
    z = (-(int32_t)cube2[i].x * (int32_t)sin_tbl[w] + (int32_t)cube2[i].z * (int32_t)cos_tbl[w]) >> 14;
    //printf("%d: %d %d --> %d %d\n", i, cube2[i].x, cube2[i].z, x, z);
    cube2[i].x = x;
    cube2[i].z = z;
  }
}

void rotate_cube_x(uint16_t w)
{
  uint8_t i;
  int16_t y, z;
  for (i = 0; i < 8; i++)
  {
    y = ((int32_t)cube2[i].y * (int32_t)cos_tbl[w] + (int32_t)cube2[i].z * (int32_t)sin_tbl[w]) >> 14;
    z = (-(int32_t)cube2[i].y * (int32_t)sin_tbl[w] + (int32_t)cube2[i].z * (int32_t)cos_tbl[w]) >> 14;
    cube2[i].y = y;
    cube2[i].z = z;
  }
}

void trans_cube(uint16_t z)
{
  uint8_t i;
  for (i = 0; i < 8; i++)
  {
    cube2[i].z += z;
  }
}

void reset_min_max(void)
{
  x_min = 0x07fff;
  y_min = 0x07fff;
  x_max = -0x07fff;
  y_max = -0x07fff;
}

// calculate xs and ys from a 3d value
void convert_3d_to_2d(struct pt3d *p3, struct pt2d *p2)
{
  int32_t t;
  p2->is_visible = 1;
  if (p3->z >= ZS)
  {
    t = ZS;
    t *= p3->x;
    t <<= 1;
    t /= p3->z;
    if (t >= -(tft.width()/2) && t <= (tft.width()/2) - 1)
    {
      t += (tft.width()/2);
      p2->x = t;

      if (x_min > t) x_min = t;
      if (x_max < t) x_max = t;

      t = ZS;
      t *= p3->y;
      t <<= 1;
      t /= p3->z;
      if (t >= -(tft.height()/2) && t <= (tft.height()/2) - 1)
      {
        t += (tft.height()/2);
        p2->y = t;
        if (y_min > t) y_min = t;
        if (y_max < t) y_max = t;
      }
      else
      {
        p2->is_visible = 0;
      }
    }
    else
    {
      p2->is_visible = 0;
    }
  }
  else
  {
    p2->is_visible = 0;
  }
}

void convert_cube(void)
{
  uint8_t i;
  reset_min_max();
  for (i = 0; i < 8; i++)
  {
    convert_3d_to_2d(cube2 + i, cube_pt + i);
  }
}

void calculate_z(void)
{
  uint8_t i, j;
  uint16_t z;
  for (i = 0; i < 6; i++)
  {
    z = 0;
    for (j = 0; j < 4; j++)
    {
      z += cube2[cube_surface[i].p[j]].z;
    }
    z /= 4;
    cube_surface[i].z = z;
    //printf("%d: z=%d\n", i, z);
  }
}

void draw_cube(void)
{
  uint8_t i, ii;
  uint8_t skip_cnt = 3;		/* it is known, that the first 3 surfaces are invisible */
  int16_t z, z_upper;
  uint16_t color;

  z_upper = 32767;
  for (;;)
  {
    ii = 6;
    z = -32767;
    for (i = 0; i < 6; i++)
    {
      if (cube_surface[i].z <= z_upper)
      {
        if (z < cube_surface[i].z)
        {
          z = cube_surface[i].z;
          ii = i;
        }
      }
    }

    if (ii >= 6) break;
    z_upper = cube_surface[ii].z;
    cube_surface[ii].z++;

    if (skip_cnt > 0)
    {
      skip_cnt--;
    }
    else
    {
      color = tft.Color565((uint8_t)(((ii + 1) & 1) * 255), (uint8_t)((((ii + 1) >> 1) & 1) * 255), (uint8_t)((((ii + 1) >> 2) & 1) * 255));
      #if defined(_WIREFRAME)
      tft.drawQuad(
        cube_pt[cube_surface[ii].p[0]].x, cube_pt[cube_surface[ii].p[0]].y,
        cube_pt[cube_surface[ii].p[1]].x, cube_pt[cube_surface[ii].p[1]].y,
        cube_pt[cube_surface[ii].p[2]].x, cube_pt[cube_surface[ii].p[2]].y,
        cube_pt[cube_surface[ii].p[3]].x, cube_pt[cube_surface[ii].p[3]].y, color);
      #else
      tft.fillQuad(
        cube_pt[cube_surface[ii].p[0]].x, cube_pt[cube_surface[ii].p[0]].y,
        cube_pt[cube_surface[ii].p[1]].x, cube_pt[cube_surface[ii].p[1]].y,
        cube_pt[cube_surface[ii].p[2]].x, cube_pt[cube_surface[ii].p[2]].y,
        cube_pt[cube_surface[ii].p[3]].x, cube_pt[cube_surface[ii].p[3]].y, color);
       #endif
    }
  }
}

void calc_and_draw(int16_t w, int16_t v)
{

  copy_cube();
  rotate_cube_y(w);
  rotate_cube_x(v);
  trans_cube(U * 8);
  convert_cube();
  calculate_z();
  draw_cube();
}


void setup(void)
{
  tft.begin();
}

int16_t w = 0;
int16_t v = 0;

void loop(void)
{
  calc_and_draw(w, v >> 3);
  v += 3;
  v &= 511;
  w++;
  w &= 63;
  delay(10);
  tft.fillRect(x_min, y_min, x_max - x_min + 3, y_max - y_min + 3, 0x0000);
}

And:
Code:
#include <SPI.h>
#include <TFT_ILI9163C.h>

/*
Teensy3.x and Arduino's
You are using 4 wire SPI here, so:
 MOSI:  11//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site)
 MISO:  12//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site)
 SCK:   13//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site)
ESP8266-----------------------------------
Use:
#define __CS  16  //(D0)
#define __DC  5   //(D1)
#define __RST 4   //(D2)

 SCLK:D5
 MOSI:D7
 */
#define __CS1 	10
#define __DC 	9
/*
Teensy 3.x can use: 2,6,10,15,20,21,22,23
Arduino's 8 bit: any
DUE: check arduino site
If you do not use reset, tie it to +3V3
*/


#if defined(TFT_ILI9163C_INSTANCES)
TFT_ILI9163C tft = TFT_ILI9163C(REDPCB_NEW, __CS1, __DC);
#else
TFT_ILI9163C tft = TFT_ILI9163C(__CS1, __DC);
#endif

void setup() {
  tft.begin();
  tft.print("hello World");
}

void loop(void) {
}

Board used is a red PCB (I used the eBay link you often provide on these forums) with yellow pins 1.44 128x128 TFT with 1.44' SPI 128*128 V1.1 printed on the back of the board. Multiple units.

Connected to Arduino Nano (multiple units) or Arduino Duemilanove (multiple units).

Pins connected are

TFT Arduino
VCC 5V
GND Gnd
CS 10
Reset 8
AO/DC 9
SDA 11
SCK 13
LED 3v3 (also tried 5v)

I've also tried redefining pins and using others, I've tested half a dozen of the TFTs and as many Arduino units, I've even changed out my breadboard and all wiring.

I've replaced the entire library with every version I was able to find, and I repaired the earlier versions that were missing the "_Display" folder, none of them seemed to work, the new library "Pre release 1.0p7" seems to be the only one that doesn't error out terribly (provides no errors in the Arduino IDE, just uploads properly than says "done uploading") however as I stated, all I get is a white screen. Nothing else.

So. Any ideas?
 
I don't know, but I'm not able to get the Display running.
I'm using a Teensy 3.2 and a V1.1 red board 1.44" with yellow headers. I'm using the latest release of the library. I checked if the right board was chosen in the settings file, and this is my header:

Code:
#include <SPI.h>
#include <TFT_ILI9163C.h>

#define __CS1 	10
#define __DC 	9
#define __RST 14

TFT_ILI9163C tft = TFT_ILI9163C(__CS1, __DC, __RST);

I tried alot of the examples, but my display always stays white. When I use the oldest library (the one in MASTER in github) and wire it to an Arduino Uno, it works. Here is a photo of my connections:

Unbenannt.jpg

Did I miss something? What can I do to get this display running?
 
I don't know, but I'm not able to get the Display running.
I'm using a Teensy 3.2 and a V1.1 red board 1.44" with yellow headers. I'm using the latest release of the library. I checked if the right board was chosen in the settings file, and this is my header:

Code:
#include <SPI.h>
#include <TFT_ILI9163C.h>

#define __CS1 	10
#define __DC 	9
#define __RST 14

TFT_ILI9163C tft = TFT_ILI9163C(__CS1, __DC, __RST);

I tried alot of the examples, but my display always stays white. When I use the oldest library (the one in MASTER in github) and wire it to an Arduino Uno, it works. Here is a photo of my connections:

View attachment 8355

Did I miss something? What can I do to get this display running?

It looks like you don't have MISO connected on pin 12? Or at all? I haven't used this library or that exact display to my knowledge, but I'm assuming that's required?
 
It looks like you don't have MISO connected on pin 12? Or at all? I haven't used this library or that exact display to my knowledge, but I'm assuming that's required?

As far as i understood the explanation, MISO is not needed.
 
If you got the settings right it should work - the ones I got were the new common ones and seems they became the default. Do you have a second display? I've had the ILI9341 go white but not sure if that applies. For both of those issues I'd have to go get my device in hand.

Ran into NO MISO the other month when I got some - Since that device doesn't support reading like the ILI9341 (touch) - for screen buffer (touch) - the MISO output from the device isn't needed.
 
No I have just the one. I have the following setting:
#include "../_display/TFT_ILI9163C_RED_PCB_YPIN.h" , but I tried all the other ones, too.

What puzzles me, is that i works with the 2 years old library I found with the UNO. The newest library does not work with the UNO, there it stays white, too. So obviously it cannot be broken
 
I had a surgical operation in July and still not 100% ok, I'm late with everithing, when I'm ok I will take care of all libraries, sorry but before I cannot even use keyboard!
 
@sumotoy - Hope you are doing better!

Not sure how much you are able to follow the forum. But there is a user who would like to have one board with a ILI9341 display with touch plus 4 of these displays on a T3.6.
More details on the thread: https://forum.pjrc.com/threads/3988...-on-Teensy-3-6?p=124551&viewfull=1#post124551

So I was curious about your support for the extra busses on the board and see you were making progress. For the fun of it, I created a version of it, using my SPIN library to see how well it would work.
So far it builds, but I have not tested it as I don't have any of these displays. One is on the way. I put up a WIP branch that I based off of your K64-K66 branch. More details on the other thread.

Again hope you are getting better!
 
Wondering if anyone has tried the ILI9163C boards from MDFLY (LCD-GR1282)

I purchased one of them through Amazon and 2 more of them directly from EBAY/MDFLY. So far I have tried two of them with both my code as well as the code shipping with Teensyduino and so far I am not getting anything but blank screen.

http://www.ebay.com/itm/381071991619

Note I have not used these displays before, but from the pictures I have seen, it looks like the old BLACK version, but it says
1.44` SPI 128*128 V2.1

Most of the others I have seen on net show V1.1.

So I may be toast with these?
 
Not sure who else uses the ILI9163C boards, but thought I would try to get a little more info on what these displays are actually... If I screw one up only lose $5+


So I pried the display up from the backing board:
ILI9163_maybe.jpg
The lettering on the White (display) side I believe says:
BL14S26A2
RX167/12/07 (maybe)

The cable part show:
HYM
H144TC215A-V0
20151117
XYL

My guess is it could be something else...
 
Thanks, I just tried running the Teensy version of Adafruit_ST7735 driver and does not respond either...

My guess is some new random controller...

Just for fun, try using the Adafruit version of the ST7735 driver instead of the current Teensy one, and perhaps try the different TAB initializations. Paul is currently looking at why the ST7735 with Teensy optimizations does not seem to work for the 128x128 displays.
 
Thanks, again so far nothing. But supposedly it is an ILI9163C controller. Maybe I will open the 3rd one and see if it is a charm.
 
in must excuse my bad english :)


I have some problems with a 1.44” SPI 128X128 V2.1 display.

I've read the whole thread to page through

and found no solution

but can see that it has previously been problems with clearScreen


20161210_001442.jpg


Code:
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <TFT_ILI9163C.h>
#include <Fonts/FreeSans24pt7b.h> 

#define BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0  
#define WHITE   0xFFFF
float trip = 10.00;
float trip1 = 10.00;
/*


 LED to 3.3V
 SCK to D13
 SDA to D11
 A0 to D8
 RST to D9
 CS to D10
 GND to GND
 VCC to 3.3V 
 */
 
#define CS 10
#define DC 9

TFT_ILI9163C tft = TFT_ILI9163C(CS, 8, DC);  

void setup()
{
  tft.begin();
  tft.fillScreen(WHITE);
}

void loop()
{
  trip = trip +0.1;
  trip1 = trip1 +0.01;
  tft.setTextColor(RED);
  tft.setFont(&FreeSans24pt7b);
  tft.setCursor(10,40);
  tft.print (trip);

  tft.setTextColor(MAGENTA);
  tft.setCursor(10,90);
  tft.print(trip1);
 
Not sure how well it supports doing output of floating point numbers. Try some other string to see if that works.
Also maybes the font does not have whatever characters it was trying to output.
 
@stig, I'm not seeing any method to clear old pixels in loop()

Either put tft.fillScreen(WHITE); in your loop, or draw white boxes into the areas you need to update (reduces flicker).
 
The tft.print method you are using does not erase the old character before writing a new character in its place.

Hence you get every character writing on top of the existing old characters which results in the blocks of filled characters your picture shows.

As suggested above, you need to ether clear the whole screen at to top of the loop (slow) or just clear the display areas used by the new characters.

In any event, to see what is going on, I suggest you put a delay(1000) or similar in your loop to allow time for your eyes to follow the progress of your code as a debugging aid. You can then remove the delay after you understand what is happening.
 
I have also tried with not floating point numbers and pure text
It makes no difference



I have tried with *fillScreen ant fillRect ant clearScreen

it helps on the problem

but then turns the nubers on and off, every time the numbers are updated


I have also tried with
tft.setTextColor(RED ,WHITE );

to update the background color around the numbers
but there is not provided a white framme around numbers


if I draw a line or a point and move it around on display
so there is no problem

so the problem is only when I use print or println
 
Status
Not open for further replies.
Back
Top