ILI9225

Hi,

Is there any other library i can used for the ILI9225, instead of draw tft.drawText.

I’m trying print a counter on screen.

help.

thanks

First off. Post a link to the actual ILI9225 display that you have bought.
Then say which library you are using. Add link.
If the display is not a plug-in Shield, say how you have wired it. Or post schematic.

The ILI9225 works fine. There are several good libraries.

Write your message in your own language. Then ask Google to translate into English before posting.
You will get good replies if you write your question carefully.

David.

thanks David.

this is how I wired it

RST 8
RS 9
CS 10
SDI 11 // MOSI
CLK 13 // SCK
LED 3
Vcc 5v

this I was previously using #include "TFT_22_ILI9225.h"

could you plz tell me what are those libraries?

Please post a link to the actual display.

Many are designed to plug straight into 5V, 0V ... A0, A1, A2, A3, A4, A5.

David.

here it is

Yes. It lines up nicely with the pins on a Uno or Mega. CS mating with Analog#5. LED mating with Analog#0.

The TFT_22_ILI9225-master library is installed on my PC. It works fine on a Uno.
But it appears to have non-standard methods.

I have written an Adafruit_GFX style library. It would need to be tidied up before I made it public.
I bet there are several other Adafruit_GFX style libraries.

David.

but i'm trying to a number counter on the screen by pressing a button,

I dont know how to do it with TFT_22_ILI9225 library.

could you help.

Post your "non-working" sketch. Someone will help you solve any problem.

It is pretty easy to drawText() and drawChar() e.g. from your H file:

 /// Draw ASCII Text (pixel coordinates)
 /// @param x point coordinate, x-axis
 /// @param y point coordinate, y-axis
 /// @param s text string
 /// @param color 16-bit color, default=white
 void drawText(uint16_t x, uint16_t y, String  s, uint16_t color = COLOR_WHITE);

 /// Draw single character (pixel coordinates)
 /// @param x point coordinate, x-axis
 /// @param y point coordinate, y-axis
 /// @param ch ASCII character
 /// @param color 16-bit color, default=white
 uint16_t drawChar(uint16_t x, uint16_t y, uint16_t ch, uint16_t color = COLOR_WHITE);

It looks as if you will need to convert any numeric expression to a String e.g.

     tft.drawText(10, 20, String(56789), COLOR_RED); //print "[color=red]56789[/color]" at pixel 10,20

If the Font draws in "transparent" mode, you may need to rubout the previous contents by drawing a fresh background before overwriting a new number.

David.

thanks David I appreciate your help.

this what I'm trying to do,

I need to add 3 pushbuttons:
up to add to the counter and scroll up from menu
down to subtract to the counter and to scroll down from menu
and select to select each item.

I'm unable to do it with tft_22_ILI9225 Library, it has limited functions.

}

void loop() {
if(analogRead(up) == LOW){
  count_1++;
  delay(50);
  tft.drawText(85, 168, "$");
  Serial.println(count_1);
}
else if(analog(down)== LOW){
count_1--;
  tft.drawText(85, 168, "$");
  Serial.println(count_1);
}

this is what I need to do

Ok, I installed the TFT_22 library on my Laptop.
And wrote this for you. Note that I plugged into A0-A5 and used Software SPI.

#include "SPI.h"
#include "TFT_22_ILI9225.h"

#define TFT_RST A4 //8
#define TFT_RS  A3 //9
#define TFT_CS  A5 //10  // SS
#define TFT_SDI A2 //11  // MOSI
#define TFT_CLK A1 //13  // SCK
#define TFT_LED A0 //3   // 0 if wired to +5V directly

// Use hardware SPI (faster - on Uno: 13-SCK, 12-MISO, 11-MOSI)
//TFT_22_ILI9225 tft = TFT_22_ILI9225(TFT_RST, TFT_RS, TFT_CS, TFT_LED);
// Use software SPI (slower)
TFT_22_ILI9225 tft = TFT_22_ILI9225(TFT_RST, TFT_RS, TFT_CS, TFT_SDI, TFT_CLK, TFT_LED);

int count_1;
const int up = 6, down = 7;

// Setup
void setup()
{
    Serial.begin(9600);
    Serial.println("Hello jaflue");
    pinMode(up, INPUT_PULLUP);
    pinMode(down, INPUT_PULLUP);
    tft.begin();
    tft.setFont(Terminal6x8);
    tft.drawText(10, 10, "Hello jaflue !");
    delay(1000);
}

void loop()
{
    if (digitalRead(up) == LOW) {
        count_1++;
        delay(50);
        tft.drawText(85, 168, "UP   ");
        tft.drawText(85, 188, String(count_1) + "  ");
        Serial.println(count_1);
    }
    else if (digitalRead(down) == LOW) {
        count_1--;
        tft.drawText(85, 168, "DOWN");
        tft.drawText(85, 188, String(count_1) + "  ");
        Serial.println(count_1);
    }
}

My Uno clone has got A6, A7 pins. But you should really use digitalRead() for reading switches.

David.

thanks David.
I will modify it.

Hi dear all! I want to order a 2 inch ILI9225 display, but it has no LED pin onboard. Any ideas on how to wire it to Uno / Nano ?

Read #3 and #5. It plugs into Analog and Power headers on a Uno, Mega, ...

You can use the hardware SPI if you want, but it is not really worth it for a small display.

David.

Hi, David! Thank you for your reply. Tell me please, how shall I modify your sketch in #10 for this TFT? Or there's no changes needed despite the lack of LED pin?

Google for the library. Install it.

Plug the display into your Uno. Line up CS with A5. Everything else should match.

Attach push buttons to 6 and 7. Or just use a flying lead from GND (next to D13) and poke it in D6 or D7 when you want to "push a button"

I guess they removed LED from A0. It was quite a lot of current for A0 pin.

From memory, that library has unusually named methods. I can probably find you an Adafruit_GFX compatible library. Get it working first.

David.