ILI9163C 128x128 TFT driver

Status
Not open for further replies.
here you can see what I mean with
the nubers on and off, every time the numbers are updated

I make the square blue so you better can see how big it is


 
You didn't publish code with your issue.

From what I can see it looks like the big blue square is a rectangle over write of the area the text goes onto, this will restore prior pixels to the clear background state.

In the upper case nothing is being done to that effect so all the old pixels written survive and new pixels are updated. You need to blank the background or save the prior written text/number and before writing the new number write the old number in its original location in the background color to clear that area. On such large numbers at the speed shown some flash will appear - but not as bad as the full rectangle draw.
 
I assume driver supports opaque text, so supply the desired background color as second parameter, and it will redraw in place.

However if your problem with this is that the font spacing is to large such that when you draw top line it overwrites second line, not sure what to tell you.

In my current ili99341 driver code in ili9341_t3n so wrong driver and not main lined, I integrated some code to set clipping rectangle for cases like that, but that functionality is probably not in this library.

Other options would be to create new font with just the number stuff and set up smaller spacing. Or build yourself a set of bitmap a for each number and draw your own numbers.
 
You didn't publish code with your issue.

have hadpublish the code in #197

but obviously that has changed little :)

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);
  tft.setFont(&FreeSans24pt7b);
}

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


  tft.setTextColor(MAGENTA);
  tft.fillRect(10,55, 115, 40,BLUE);
  tft.setCursor(10,90);
  tft.println(trip1);
delay(19);
}
 
I assume driver supports opaque text, so supply the desired background color as second parameter, and it will redraw in place.

However if your problem with this is that the font spacing is to large such that when you draw top line it overwrites second line, not sure what to tell you.

In my current ili99341 driver code in ili9341_t3n so wrong driver and not main lined, I integrated some code to set clipping rectangle for cases like that, but that functionality is probably not in this library.

Other options would be to create new font with just the number stuff and set up smaller spacing. Or build yourself a set of bitmap a for each number and draw your own numbers.

I will make a font with only numbers but after that I have not tried it before so I want to mastered the problem of numbers are not deleted from the display when it is written a new number in the same position
 
What happens if you do something like:
Code:
void loop()
{
   trip = trip +0.01;
  trip1 = trip1 +0.01;
 
  tft.setTextColor(RED, WHITE);
  tft.setCursor(10,40);
  tft.print (trip);


  tft.setTextColor(MAGENTA, BLUE);
  tft.fillRect(10,55, 115, 40,BLUE);
  tft.setCursor(10,90);
  tft.println(trip1);
delay(19);
}
For sure your bottom line will erase and redraw each time, as you do a fillRect. But in theory you could move that to Setup...
Also my quick five minute look at sources, looks like their Opaque drawing code for characters, simply does a fillRect of the spacing. So it will flash a little anyway...

Another option is to do something like:
Code:
void loop()
{
  tft.setTextColor(WHITE);
  tft.setCursor(10,40);
  tft.print (trip);

  tft.setTextColor(BLUE);
//  tft.fillRect(10,55, 115, 40,BLUE);  // maybe can live in Setup?
  tft.setCursor(10,90);
  tft.println(trip1);

   trip = trip +0.01;
  trip1 = trip1 +0.01;
 
  tft.setTextColor(RED);
  tft.setCursor(10,40);
  tft.print (trip);


  tft.setTextColor(MAGENTA);
//  tft.fillRect(10,55, 115, 40,BLUE);
  tft.setCursor(10,90);
  tft.println(trip1);
delay(19);
}
It redraws the text each time back in the background color, then updates the text to draw it with the desired color. But this again would give you a flash between updates. Other options include, trying to detect which characters are actually updated and position and output those only... But that is more work, but then only those characters would undraw/redraw...
 
What happens if you do something like:
Code:
void loop()
{
   trip = trip +0.01;
  trip1 = trip1 +0.01;
 
  tft.setTextColor(RED, WHITE);
  tft.setCursor(10,40);
  tft.print (trip);


  tft.setTextColor(MAGENTA, BLUE);
  tft.fillRect(10,55, 115, 40,BLUE);
  tft.setCursor(10,90);
  tft.println(trip1);
delay(19);
}

It's going to look like this
 
What happens if you do something like:

Another option is to do something like:
Code:
void loop()
{
  tft.setTextColor(WHITE);
  tft.setCursor(10,40);
  tft.print (trip);

  tft.setTextColor(BLUE);
//  tft.fillRect(10,55, 115, 40,BLUE);  // maybe can live in Setup?
  tft.setCursor(10,90);
  tft.println(trip1);

   trip = trip +0.01;
  trip1 = trip1 +0.01;
 
  tft.setTextColor(RED);
  tft.setCursor(10,40);
  tft.print (trip);


  tft.setTextColor(MAGENTA);
//  tft.fillRect(10,55, 115, 40,BLUE);
  tft.setCursor(10,90);
  tft.println(trip1);
delay(19);
}

It's going to look like this
 
I've tried to move around on the code

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);
  tft.setFont(&FreeSans24pt7b);
}


void loop()
{
  tft.setTextColor(WHITE);
  tft.setCursor(10,40);
  tft.print (trip);
  trip = trip +0.01;
  
  tft.setTextColor(RED);
  tft.setCursor(10,40);
  tft.print (trip);
  
  tft.setTextColor(WHITE);
  tft.setCursor(10,90);
  tft.println(trip1);

  trip1 = trip1 +0.01;
 
  tft.setTextColor(MAGENTA);
  tft.setCursor(10,90);
  tft.println(trip1);
}
It's going to look like this


I'd better get looking at getting into some
not transparent Fonts
it must be able to solve the problem
 
Then I found a solution

it is the fonts I used which was too long to load
as far as I can figure out


The fonts I use now is not very pretty but the work until I get made another

Code:
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <TFT_ILI9163C.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);
  tft.setTextSize(3);
}


void loop()
{
  tft.setTextColor(WHITE);
  tft.setCursor(10,40);
  tft.print (trip);
  trip = trip +0.01;
  
  tft.setTextColor(RED);
  tft.setCursor(10,40);
  tft.print (trip);
  
  tft.setTextColor(WHITE);
  tft.setCursor(10,90);
  tft.print(trip1);

  trip1 = trip1 +0.01;
 
  tft.setTextColor(MAGENTA);
  tft.setCursor(10,90);
  tft.print(trip1);
}

 
have hadpublish the code in #197

but obviously that has changed little :)

opps - I saw post at top of page not seeing it as mid thread - so didn't read history.

Is the sketch your actual desired output? One or more large sized number displays? Where leading digits change less than trailing digits? Large area digits are lots of spi data to clear and draw for.

If that is what desired code could be written to minimize what is sent to the display - balancing between not writing what doesn't change and using code to track what was written last and re-write that in background before the new digits.

There is a >> TFT_ILI9163C::getCursor(int16_t &x, int16_t &y)

There is example usage I posted to this thread in May - post #119 and #121

Look for the function:
// tft. Self Cleaning String print
uint32_t tftSCprint( uint32_t oldV, uint32_t newV, uint16_t fgc, uint16_t bgc )

If the sketch provided shows your desired usage it would be best to print the print before and after the decimal as two numbers - so only half will flash at a time and only when changed and never leave behind 'old' pixels. With less area changing the flash will be much faster too.
 
I have come a little further


If the display must refresh too much at once then it goes wrong



I've created two test which clearly shows the

Test 1 and Test 2

Test1 counts clearly very slowly than test2

Test 1 update the entire digit when the loop is read

it gives slower display update ant flicker

Test 2 update only when a digit a Changed


it provides fast display update ant none flicker



See the next two posts
 
TEST 1


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 tal1 = 0;

int Plus1 = 4;
/*


 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()
{
//  Serial.begin(9600);
  tft.begin();
  tft.fillScreen(WHITE);
  tft.setFont(&FreeSans24pt7b);
  tft.setTextColor(RED);
  tft.setCursor(10,40);
  tft.print (tal1); 
  Serial.print("TAL 1  : "); Serial.println(tal1);
}

void loop()
{
  if (digitalRead(Plus1)== HIGH)
                                  {
                                  tft.setTextColor(WHITE);
                                  tft.setCursor(10,40);
                                  tft.print (tal1);
                                  tal1 = tal1+0.01;
                                  tft.setTextColor(RED);
                                  tft.setCursor(10,40);
                                  tft.print (tal1); 
                                //  Serial.print("TAL 1  : "); Serial.println(tal1);
                               //   delay(300);                           
                                  }
}
 
TEST 2


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
int cif1 = 100;
int cif2 = 74;
int cif3 = 35;
int cif4 = 10;
int tal1 = 0;
int tal2 = 0;
int tal3 = 0;
int tal4 = 0;
int Plus1 = 4;
/*


 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);
  tft.setFont(&FreeSans24pt7b);
  tft.setTextColor(RED);
  tft.setCursor(cif1,40);
  tft.print (tal1);
  tft.setTextColor(RED);
  tft.setCursor(cif2,40);
  tft.print (tal2);
  tft.setTextColor(RED);
  tft.setCursor(cif3,40);
  tft.print (tal3);
  tft.setTextColor(RED);
  tft.setCursor(cif4,40);
  tft.print (tal4);
  tft.setTextColor(RED);
  tft.setCursor(63,40);
  tft.print (".");
/*
  Serial.begin(9600);
  Serial.print("TAL 1  : "); Serial.println(tal1);
  Serial.print("TAL 2  : "); Serial.println(tal2);
  Serial.print("TAL 3  : "); Serial.println(tal3);
  Serial.print("TAL 4  : "); Serial.println(tal4);
  Serial.println("");
  Serial.println("");

  */
}

void loop()
{
  if (digitalRead(Plus1)== HIGH)
              {
                                     tft.setTextColor(WHITE);
                                     tft.setCursor(cif1,40);
                                     tft.print (tal1);
                                     tal1 = tal1+1;
                                  
                         if (tal1 < 9)
                                     {
                                      tft.setTextColor(RED);
                                      tft.setCursor(cif1,40);
                                      tft.print (tal1);
                                     }
                                     
                          if (tal1==9)
                                     {
                                      tft.setTextColor(RED);
                                      tft.setCursor(cif1,40);
                                      tft.print (tal1);
                                      }
                          if (tal1 > 9)
                                      {
                                      tft.setTextColor(WHITE);
                                      tft.setCursor(cif1,40);
                                      tft.print (tal1);
                                      tal1 =0;
                                      tft.setTextColor(RED);
                                      tft.setCursor(cif1,40);
                                      tft.print (tal1);


                                      

                                                tft.setTextColor(WHITE);
                                                tft.setCursor(cif2,40);
                                                tft.print (tal2);
                                                tal2 = tal2+1;
                                                tft.setTextColor(WHITE);
                                                tft.setCursor(cif2,40);
                                                tft.print (tal2);

                                  if (tal2 < 9)
                                                {
                                                tft.setTextColor(RED);
                                                tft.setCursor(cif2,40);
                                                tft.print (tal2);
                                                }

                                  if (tal2==9)
                                                {
                                                tft.setTextColor(RED);
                                                tft.setCursor(cif2,40);
                                                tft.print (tal2);
                                                 }
                                  if (tal2 > 9)
                                                {
                                                tft.setTextColor(WHITE);
                                                tft.setCursor(cif2,40);
                                                tft.print (tal2);
                                                tal2 =0;
                                                tft.setTextColor(RED);
                                                tft.setCursor(cif2,40);
                                                tft.print (tal2);
                                                
                                                tft.setTextColor(RED);
                                                tft.setCursor(cif1,40);
                                                tft.print (tal1);

                                                           tft.setTextColor(WHITE);
                                                           tft.setCursor(cif3,40);
                                                           tft.print (tal3);
                                                           tal3 = tal3+1;
                                                           tft.setTextColor(WHITE);
                                                           tft.setCursor(cif3,40);
                                                           tft.print (tal3);

                                             if (tal3 < 9)
                                                           {
                                                           tft.setTextColor(RED);
                                                           tft.setCursor(cif3,40);
                                                           tft.print (tal3);
                                                           }

                                             if (tal3==9)
                                                           {
                                                           tft.setTextColor(RED);
                                                           tft.setCursor(cif3,40);
                                                           tft.print (tal3);
                                                           }
                                            if (tal3 > 9)
                                                           {
                                                           tft.setTextColor(WHITE);
                                                           tft.setCursor(cif3,40);
                                                           tft.print (tal3);
                                                           tal3 =0;
                                                           tft.setTextColor(RED);
                                                           tft.setCursor(cif3,40);
                                                           tft.print (tal3);
                                                
                                                           tft.setTextColor(RED);
                                                           tft.setCursor(cif2,40);
                                                           tft.print (tal2);
                                                           tft.setCursor(63,40);
                                                           tft.print (".");



                                                           tft.setTextColor(WHITE);
                                                           tft.setCursor(cif4,40);
                                                           tft.print (tal4);
                                                           tal4 = tal4+1;
                                                           tft.setTextColor(WHITE);
                                                           tft.setCursor(cif4,40);
                                                           tft.print (tal4);

                                             if (tal4 < 9)
                                                           {
                                                           tft.setTextColor(RED);
                                                           tft.setCursor(cif4,40);
                                                           tft.print (tal4);
                                                           }

                                             if (tal4==9)
                                                           {
                                                           tft.setTextColor(RED);
                                                           tft.setCursor(cif4,40);
                                                           tft.print (tal4);
                                                           }
                                            if (tal4 > 9)
                                                           {
                                                           tft.setTextColor(WHITE);
                                                           tft.setCursor(cif4,40);
                                                           tft.print (tal4);
                                                           tal4 =0;
                                                           tft.setTextColor(RED);
                                                           tft.setCursor(cif4,40);
                                                           tft.print (tal4);
                                                
                                                           tft.setTextColor(RED);
                                                           tft.setCursor(cif3,40);
                                                           tft.print (tal3);
                                                           }
                                                           
                                                           }
                                                }
                                      }

                                 
                                  
                                   
           /*                       Serial.print("TAL 1  : "); Serial.println(tal1);
                                  Serial.print("TAL 2  : "); Serial.println(tal2);
                                  Serial.print("TAL 3  : "); Serial.println(tal3);
                                  Serial.print("TAL 4  : "); Serial.println(tal4);
                                  Serial.println("");
                                  Serial.println("");

            */                      
                               //   delay(300);                           
                 }
                          
}
 
opps - I saw post at top of page not seeing it as mid thread - so didn't read history.

Is the sketch your actual desired output? One or more large sized number displays? Where leading digits change less than trailing digits? Large area digits are lots of spi data to clear and draw for.

If that is what desired code could be written to minimize what is sent to the display - balancing between not writing what doesn't change and using code to track what was written last and re-write that in background before the new digits.

There is a >> TFT_ILI9163C::getCursor(int16_t &x, int16_t &y)

There is example usage I posted to this thread in May - post #119 and #121

Look for the function:

If the sketch provided shows your desired usage it would be best to print the print before and after the decimal as two numbers - so only half will flash at a time and only when changed and never leave behind 'old' pixels. With less area changing the flash will be much faster too.


I also intend to try your method for comparing
 
so I have made code that works somewhat faster

the new code calculates the different digit

and chiffren will only be updated on the display if the records have been changed

the new code is also very manageable


old code
counts from 0 – 99.99
time 12.06 min




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
                             int cif1 = 100;
                             int cif2 = 74;
                             int cif3 = 35;
                             int cif4 = 10;
                             int tal1 = 0;
                             int tal2 = 0;
                             int tal3 = 0;
                             int tal4 = 0;
                             int Plus1 = 4;
/*


 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);
  tft.setFont(&FreeSans24pt7b);
  tft.setTextColor(RED);
  tft.setCursor(cif1,40);
  tft.print (tal1);
  tft.setTextColor(RED);
  tft.setCursor(cif2,40);
  tft.print (tal2);
  tft.setTextColor(RED);
  tft.setCursor(cif3,40);
  tft.print (tal3);
  tft.setTextColor(RED);
  tft.setCursor(cif4,40);
  tft.print (tal4);
  tft.setTextColor(RED);
  tft.setCursor(63,40);
  tft.print (".");
}

void loop()
{
  if (digitalRead(Plus1)== HIGH)
              {
                                     tft.setTextColor(WHITE);
                                     tft.setCursor(cif1,40);
                                     tft.print (tal1);
                                     tal1 = tal1+1;
                                  
                         if (tal1 < 9)
                                     {
                                      tft.setTextColor(RED);
                                      tft.setCursor(cif1,40);
                                      tft.print (tal1);
                                     }
                                     
                          if (tal1==9)
                                     {
                                      tft.setTextColor(RED);
                                      tft.setCursor(cif1,40);
                                      tft.print (tal1);
                                      }
                          if (tal1 > 9)
                                      {
                                      tft.setTextColor(WHITE);
                                      tft.setCursor(cif1,40);
                                      tft.print (tal1);
                                      tal1 =0;
                                      tft.setTextColor(RED);
                                      tft.setCursor(cif1,40);
                                      tft.print (tal1);


                                      

                                                tft.setTextColor(WHITE);
                                                tft.setCursor(cif2,40);
                                                tft.print (tal2);
                                                tal2 = tal2+1;
                                                tft.setTextColor(WHITE);
                                                tft.setCursor(cif2,40);
                                                tft.print (tal2);

                                  if (tal2 < 9)
                                                {
                                                tft.setTextColor(RED);
                                                tft.setCursor(cif2,40);
                                                tft.print (tal2);
                                                }

                                  if (tal2==9)
                                                {
                                                tft.setTextColor(RED);
                                                tft.setCursor(cif2,40);
                                                tft.print (tal2);
                                                 }
                                  if (tal2 > 9)
                                                {
                                                tft.setTextColor(WHITE);
                                                tft.setCursor(cif2,40);
                                                tft.print (tal2);
                                                tal2 =0;
                                                tft.setTextColor(RED);
                                                tft.setCursor(cif2,40);
                                                tft.print (tal2);
                                                
                                                tft.setTextColor(RED);
                                                tft.setCursor(cif1,40);
                                                tft.print (tal1);

                                                           tft.setTextColor(WHITE);
                                                           tft.setCursor(cif3,40);
                                                           tft.print (tal3);
                                                           tal3 = tal3+1;
                                                           tft.setTextColor(WHITE);
                                                           tft.setCursor(cif3,40);
                                                           tft.print (tal3);

                                             if (tal3 < 9)
                                                           {
                                                           tft.setTextColor(RED);
                                                           tft.setCursor(cif3,40);
                                                           tft.print (tal3);
                                                           }

                                             if (tal3==9)
                                                           {
                                                           tft.setTextColor(RED);
                                                           tft.setCursor(cif3,40);
                                                           tft.print (tal3);
                                                           }
                                            if (tal3 > 9)
                                                           {
                                                           tft.setTextColor(WHITE);
                                                           tft.setCursor(cif3,40);
                                                           tft.print (tal3);
                                                           tal3 =0;
                                                           tft.setTextColor(RED);
                                                           tft.setCursor(cif3,40);
                                                           tft.print (tal3);
                                                
                                                           tft.setTextColor(RED);
                                                           tft.setCursor(cif2,40);
                                                           tft.print (tal2);
                                                           tft.setCursor(63,40);
                                                           tft.print (".");



                                                           tft.setTextColor(WHITE);
                                                           tft.setCursor(cif4,40);
                                                           tft.print (tal4);
                                                           tal4 = tal4+1;
                                                           tft.setTextColor(WHITE);
                                                           tft.setCursor(cif4,40);
                                                           tft.print (tal4);

                                             if (tal4 < 9)
                                                           {
                                                           tft.setTextColor(RED);
                                                           tft.setCursor(cif4,40);
                                                           tft.print (tal4);
                                                           }

                                             if (tal4==9)
                                                           {
                                                           tft.setTextColor(RED);
                                                           tft.setCursor(cif4,40);
                                                           tft.print (tal4);
                                                           }
                                            if (tal4 > 9)
                                                           {
                                                           tft.setTextColor(WHITE);
                                                           tft.setCursor(cif4,40);
                                                           tft.print (tal4);
                                                           tal4 =0;
                                                           tft.setTextColor(RED);
                                                           tft.setCursor(cif4,40);
                                                           tft.print (tal4);
                                                
                                                           tft.setTextColor(RED);
                                                           tft.setCursor(cif3,40);
                                                           tft.print (tal3);
                                                           }
                                                           
                                                           }
                                                }
                                      }

                     
                               //   delay(300);                           
                 }
                          
}

new code
counts from 0 – 99.99
time 10.38 min


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
                             
                             
                             
                             int cif1  = 10;
                             int cif2  = 35;
                             int cif3  = 74;
                             int cif4  = 100;
                             
                             int total = 0;
                             int Plus1 = 4;
                             
                             long tal1          = 0;
                             int  Lasttal1State = 0;
                             
                             long tal2          = 0;
                             int  Lasttal2State = 0;
                             
                             long tal3          = 0;
                             int  Lasttal3State = 0;
                             
                             long tal4          = 0;
                             int  Lasttal4State = 0;
                                  
/*


 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);
                             tft.setFont(&FreeSans24pt7b);
                             
                             tal1 = (total/1000)-((total/10000)*10);
                             tal2 = (total/100)-((total/1000)*10);
                             tal3 = (total/10)-((total/100)*10);
                             tal4 = total-((total/10)*10);

                             Lasttal1State = tal1;
                             Lasttal2State = tal2;
                             Lasttal3State = tal3;
                             Lasttal4State = tal4;
                             Lasttal4State = tal4;
                             
                             
                             tft.setTextColor(RED);
                             tft.setCursor(cif1,40);
                             tft.print (tal1);
  
                             tft.setTextColor(RED);
                             tft.setCursor(cif2,40);
                             tft.print (tal2);

                             tft.setTextColor(RED);
                             tft.setCursor(cif3,40);
                             tft.print (tal3);
  
                             tft.setTextColor(RED);
                             tft.setCursor(cif4,40);
                             tft.print (tal4);
  
                             tft.setTextColor(RED);
                             tft.setCursor(63,40);
                             tft.print (".");

  
}

void loop()
{
  
                          if (digitalRead(Plus1)== HIGH)
                             {
                             total = total+1;
                          //   delay(400);
                             }
                             
                          if (total > 9999)
                             {
                             total = 0;
                             }
                                
                             tal1 = (total/1000)-((total/10000)*10);
                             tal2 = (total/100)-((total/1000)*10);
                             tal3 = (total/10)-((total/100)*10);
                             tal4 = total-((total/10)*10);


                           


                          if (tal1 != Lasttal1State)
                             {
                             tft.setTextColor(WHITE);
                             tft.setCursor(cif1,40);
                             tft.print (Lasttal1State);
                                  
                             tft.setTextColor(RED);
                             tft.setCursor(cif1,40);
                             tft.print (tal1);
                             Lasttal1State = tal1;
                             }

                         if (tal2 != Lasttal2State)
                             {
                             tft.setTextColor(WHITE);
                             tft.setCursor(cif2,40);
                             tft.print (Lasttal2State);
                                  
                             tft.setTextColor(RED);
                             tft.setCursor(cif2,40);
                             tft.print (tal2);
                             Lasttal2State = tal2;
                             }

                          if (tal3 != Lasttal3State)
                             {
                             tft.setTextColor(WHITE);
                             tft.setCursor(cif3,40);
                             tft.print (Lasttal3State);
                                  
                             tft.setTextColor(RED);
                             tft.setCursor(cif3,40);
                             tft.print (tal3);
                             Lasttal3State = tal3;
                             }

                          if (tal4 != Lasttal4State)
                             {
                             tft.setTextColor(WHITE);
                             tft.setCursor(cif4,40);
                             tft.print (Lasttal4State);
                                  
                             tft.setTextColor(RED);
                             tft.setCursor(cif4,40);
                             tft.print (tal4);
                             Lasttal4State = tal4;
                             }
}

Thanks for the help and inspiration you have come with:cool::cool:
 
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:
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...

I got the exact same one from AliExpress. It was supposed to be a ST7735S, but what I got doesn't match the vendor's pictures, so they may have sent me a random display. I have a version with only the ribbon connector though, no PCB with pin labels. Could you look at your PCB and tell me what each ribbon pad is connected to?
 
Hi all. Sorry to bring this thread back but I've been having a nightmare trying to get my display to work with this driver.

It's a red PCB with yellow header pins, and it says "1.44' SPI 128x128 V1.1", but no matter what offset settings I use, I can't get it to display the full screen. The image is offset upwards and to the left.
HZebHMp.png


I'm using version 0.9 of Sumotoy's driver on a Teensy 3.2, I'm aware that v1.0p7 has better support for the red PCB's with yellow headers, but I can't get the display to respond at all with the new driver, hence why I'm testing on 0.9

Pins:
LED > 3v3
SCK > 13
SDA > 11(MOSI)
A0 > 6
RESET > 3v3
CS > 10


I'm running the benchmark example, completely un-edited, and by default, this is what I'm seeing on my display:
sOBwN61.png


I'm aware of some different displays having offset issues, so I tried un-commenting the
Code:
#define __144_BLACK_PCB__//128x128
line instead, but the display is still off, now the image is off-screen at the top and the left offset hasn't been changed.
PtZ5Dff.png


Has anyone else been able to use this display successfully? I'm out of ideas as to why I can't get it to work properly on v0.9 and why it won't work at all on v1.0p7. Any help would be greatly appreciated!
 
Last edited:
@oblique_display

After much transiting of similar rabbit holes I've got my similar looking but failing in a slightly different way displays working using
https://github.com/sumotoy/TFT_ILI93XX
but had to go into the display directory and change the file there so that display x/y was 128 by 128 manually. Even there some rotations don't work but I think it's good enough for my needs.

Unsure if there is a better way to do that, since that newer library has only one display file where old one had several for different models.
 
I'm currently using this library on a Teensy 3.2 to control an ILI9163C-based display. It's working perfectly, however my project requires the use of 5 of these displays. It looks as though this won't be possible on Teensy, as there are only 5x CS/DC pins available (9,10,15,20,21).

Is this a hardware limitation, or can it be handled with a modified library?

Would I need 3x Teensy 3.2 units to achieve this? Is there an alternative microcontroller in the range that can achieve this?

If there is concern over the capability ot Teensy 3.2 to run multiple displays, I am using these as status indicators only, and am aiming for r a refresh rate of between 1 and 5Hz.

The display in question, not that it should matter: https://www.ebay.co.uk/itm/303244596482
 
Simple Answer is his library won't support it.

Longer answer is, maybe it will work with my hacked up version of the library: https://github.com/KurtE/TFT_ILI9163C/tree/SPIN-version
It uses my SPIN library and I don't even guarantee it still compiles, as I have not touched this since the T3.5/6 beta time frame (about 3 years ago).

But in this version with T3.x There is code that relaxes the requirement that the CS pin must be a hardware CS pin. It still requires the DC pin to be hardware CS.

But you can always try it and see if it works for you.

Notes to self and others: At some point we may need to figure out a decent way to handle libraries like this whose owner is no longer active, but others still use.
 
Thanks for this, I have tried it out and it does indeed fail to compile with the following error:

C:\Users\xxxx\Documents\Arduino\libraries\TFT_ILI9163C-SPIN-version\TFT_ILI9163C.cpp:64:28: error: 'class SPINClass' has no member named 'kinetisk_spi'

_pkinetisk_spi = _pspin->kinetisk_spi();

I've tried with Teensy 3.2 and 3.5 Using the SPIN library from your github.
 
Status
Not open for further replies.
Back
Top