error msg in serial communication

im using Arduino 0022 version
because that one is supportable for the TFT Screen Im using. ( ILI9320)
when im moving with it , i worked in serial reading
the function readBytesUntil
there is an error comes and it says

"class HardwareSerial has no member named readBytesUntil "

now what can i do ??? :frowning: :frowning: :frowning:
really sad it is.

void testtext12(uint16_t color)                                                                             //  ACK    ^
    {      
      if(e5<1)
       {
       Serial.print("^");                                                                                     //    ^   sign to ACK pc to send info
      e5++; 
        }
        delay(200);
        
       if (Serial.available() > 0) 
        {
          [color=blue] int bytesRead = Serial.readBytesUntil('*', credit, 4);         [/color]
        }
        
        tft.setCursor(50, 40);
      tft.setTextColor(BLUE);
      tft.setTextSize(4);
      tft.print( credit[0]);
      tft.print(credit[1]);
      tft.print( credit[2]);
      tft.print(credit[3]);    
                                                                                             
    }

im using Arduino 0022 version

Update it, and all will be well.

the issue is
when i did this in 1.0.4
lot of errors comes.
i think the LCD controller driver is only support for 0022.

Is this thread for
speaking entirely in
Japanese Haiku?

Using functions from
new version of Arduino
in old will not work.

Upgrade your version
and tell us the new error
your program gives you.

Arduino: 1.5.3 (Windows 7), Board: "Arduino Mega 2560 or Mega ADK"

In file included from sketch_sep04a.ino:17:
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:65: error: expected class-name before '{' token
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:67: error: expected `)' before 'cs'
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:69: error: 'uint16_t' does not name a type
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:74: error: 'uint16_t' has not been declared
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:74: error: 'uint16_t' has not been declared
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:74: error: 'uint16_t' has not been declared
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:75: error: 'uint16_t' has not been declared
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:76: error: 'int16_t' has not been declared
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:76: error: 'int16_t' has not been declared
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:76: error: 'int16_t' has not been declared
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:76: error: 'int16_t' has not been declared
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:76: error: 'uint16_t' has not been declared
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:77: error: 'uint16_t' has not been declared
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:77: error: 'uint16_t' has not been declared
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:77: error: 'uint16_t' has not been declared
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:77: error: 'uint16_t' has not been declared
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:77: error: 'uint8_t' has not been declared
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:78: error: 'uint16_t' has not been declared
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:78: error: 'uint16_t' has not been declared
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:78: error: 'uint16_t' has not been declared
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:78: error: 'uint16_t' has not been declared
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:79: error: 'uint16_t' has not been declared
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:79: error: 'uint16_t' has not been declared
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:79: error: 'uint16_t' has not been declared
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:79: error: 'uint16_t' has not been declared
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:80: error: 'uint16_t' has not been declared
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:80: error: 'uint16_t' has not been declared
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:81: error: 'uint16_t' has not been declared

sketch_sep04a:39: error: no matching function for call to 'TFTLCD::TFTLCD(const uint8_t&, const uint8_t&, const uint8_t&, const uint8_t&, const uint8_t&)'
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:65: note: candidates are: TFTLCD::TFTLCD()
C:\Users\Dell\Desktop\0022\arduino-1.5.3\libraries\TFTLCD/TFTLCD.h:65: note: TFTLCD::TFTLCD(const TFTLCD&)
sketch_sep04a.ino: In function 'void testtext(uint16_t)':
sketch_sep04a:266: error: 'class TFTLCD' has no member named 'println'
sketch_sep04a:269: error: 'class TFTLCD' has no member named 'println'
sketch_sep04a:273: error: 'class TFTLCD' has no member named 'print'
sketch_sep04a.ino: In function 'void testtext5(uint16_t)':
sketch_sep04a:288: error: 'class TFTLCD' has no member named 'println'
sketch_sep04a:291: error: 'class TFTLCD' has no member named 'println'
sketch_sep04a:294: error: 'class TFTLCD' has no member named 'print'
sketch_sep04a:295: error: 'class TFTLCD' has no member named 'print'
sketch_sep04a:296: error: 'class TFTLCD' has no member named 'print'
sketch_sep04a:297: error: 'class TFTLCD' has no member named 'print'
sketch_sep04a.ino: In function 'void testtext2(uint16_t)':
sketch_sep04a:309: error: 'class TFTLCD' has no member named 'width'
sketch_sep04a:309: error: 'class TFTLCD' has no member named 'height'
sketch_sep04a:310: error: 'class TFTLCD' has no member named 'print'
sketch_sep04a:312: error: 'class TFTLCD' has no member named 'print'
sketch_sep04a:315: error: 'class TFTLCD' has no member named 'width'
sketch_sep04a:315: error: 'class TFTLCD' has no member named 'height'
sketch_sep04a:316: error: 'class TFTLCD' has no member named 'print'
sketch_sep04a:318: error: 'class TFTLCD' has no member named 'print'

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

in V 0022 it compiled successfully
but it errors in 1.5.2

but both with same header file TFTLCD.h

https://www.dropbox.com/s/oopgg1mumhlmf31/TFTLCD.h

Dropbox - Error - Simplify your life

Not going there. The Arduino forum provides a non-virus-infected way to share code. Look at the Additional Options link when typing a response. Add the file as an attachment.

Anyway, the issue looks like TFTLCD.h hasn't been updated for 1.0+ use.

https://www.dropbox.com/sh/gbs4n1pt1tr7tpt/w0gLWKQmwI

may be that was the reason " TFTLCD.h hasn't been updated for 1.0+ use ".

the manufacturer is not keen in updating.

how can i do this ?

how can i do this ?

How can you do what? I'll assume that the link to dropbox has some relationship to the question. There is, however, no reason to be using some potentially virus-infected site to host things that the forum can host for you, and that we can then all open.

majenko:
Is this thread for
speaking entirely in
Japanese Haiku?

Entirely, it is not.

Entirely, it is not.

Ah, like Yoda its pattern the thread is developing

AWOL:

Entirely, it is not.

Ah, like Yoda its pattern the thread is developing

Indubitably, my dear AWOLtson.

sorry
just im seeing the option :relaxed: :relaxed: :relaxed:

TFTLCD.h (4.85 KB)

TFTLCD.cpp (21.1 KB)

sketch_sep05a.ino (16 KB)

Change "Wprogram.h" to "Arduino.h"
Make sure "TFTLCD::write" has the correct return type and returns 1.
(Don't forget to correct the prototype in the ".h", and the method itself in the ".cpp")

I think that's about it - it compiles for me, but I can't test it.

 virtual void write(uint8_t);

when i placed " Arduino.h ".
all other errors are eliminated.
the two you mentioned exists.

dear im a newbie.
how to
Make sure "TFTLCD::write" has the correct return type and returns 1 ?

"TFTLCD::write" should be of type "size_t" instead of "void", and it needs a "return"

size_t TFTLCD::write(uint8_t c) { 
  if (c == '\n') {
    cursor_y += textsize*8;
    cursor_x = 0;
  } else if (c == '\r') {
    // skip em
  } else {
    drawChar(cursor_x, cursor_y, c, textcolor, textsize);
    cursor_x += textsize*6;
  }
  return (size_t) 1;
}

very first i placed #include <Arduino.h> in .h

then
I Corrected in .cpp

size_t TFTLCD::write(uint8_t c) { 
  if (c == '\n') {
    cursor_y += textsize*8;
    cursor_x = 0;
  } else if (c == '\r') {
    // skip em
  } else {
    drawChar(cursor_x, cursor_y, c, textcolor, textsize);
    cursor_x += textsize*6;
  }
  return (size_t) 1;
}

is that all ?

Does it compile ?

If yes, does it work ?

-- A programmer should do tests as well :wink:

is that all ?

See reply #14