prenticedavid / MCUFRIEND_kbv

MCUFRIEND_kbv Library for Uno 2.4, 2.8, 3.5, 3.6, 3.95 inch mcufriend Shields
Other
357 stars 177 forks source link

help #137

Closed mokey808 closed 3 years ago

mokey808 commented 4 years ago

can some one help me i dont know what this error is im trying to port this and i dont know what to do

Arduino: 1.8.1 (Windows 8.1), Board: "Arduino/Genuino Uno"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\keanu\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\keanu\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\keanu\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10801 -build-path C:\Users\keanu\AppData\Local\Temp\arduino_build_917559 -warnings=none -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\keanu\Desktop\tfterminal\tfterminal\tfterminal.ino C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\keanu\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\keanu\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\keanu\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10801 -build-path C:\Users\keanu\AppData\Local\Temp\arduino_build_917559 -warnings=none -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\keanu\Desktop\tfterminal\tfterminal\tfterminal.ino Using board 'uno' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr Detecting libraries used... "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10801 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\keanu\AppData\Local\Temp\arduino_build_917559\sketch\tfterminal.ino.cpp" -o "nul" "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10801 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "C:\Users\keanu\AppData\Local\Temp\arduino_build_917559\sketch\tfterminal.ino.cpp" -o "nul" "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10801 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "-IC:\Users\keanu\Documents\Arduino\libraries\Adafruit_GFX_Library" "C:\Users\keanu\AppData\Local\Temp\arduino_build_917559\sketch\tfterminal.ino.cpp" -o "nul" "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10801 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "-IC:\Users\keanu\Documents\Arduino\libraries\Adafruit_GFX_Library" "-IC:\Users\keanu\Documents\Arduino\libraries\MCUFRIEND_kbv" "C:\Users\keanu\AppData\Local\Temp\arduino_build_917559\sketch\tfterminal.ino.cpp" -o "nul" "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10801 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "-IC:\Users\keanu\Documents\Arduino\libraries\Adafruit_GFX_Library" "-IC:\Users\keanu\Documents\Arduino\libraries\MCUFRIEND_kbv" "C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src\SPI.cpp" -o "nul" "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10801 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "-IC:\Users\keanu\Documents\Arduino\libraries\Adafruit_GFX_Library" "-IC:\Users\keanu\Documents\Arduino\libraries\MCUFRIEND_kbv" "C:\Users\keanu\Documents\Arduino\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp" -o "nul" "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10801 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "-IC:\Users\keanu\Documents\Arduino\libraries\Adafruit_GFX_Library" "-IC:\Users\keanu\Documents\Arduino\libraries\MCUFRIEND_kbv" "C:\Users\keanu\Documents\Arduino\libraries\Adafruit_GFX_Library\Adafruit_SPITFT.cpp" -o "nul" "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10801 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "-IC:\Users\keanu\Documents\Arduino\libraries\Adafruit_GFX_Library" "-IC:\Users\keanu\Documents\Arduino\libraries\MCUFRIEND_kbv" "C:\Users\keanu\Documents\Arduino\libraries\Adafruit_GFX_Library\glcdfont.c" -o "nul" "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10801 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "-IC:\Users\keanu\Documents\Arduino\libraries\Adafruit_GFX_Library" "-IC:\Users\keanu\Documents\Arduino\libraries\MCUFRIEND_kbv" "-IC:\Users\keanu\Documents\Arduino\libraries\MCUFRIEND_kbv\utility" "C:\Users\keanu\Documents\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp" -o "nul" Generating function prototypes... "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10801 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "-IC:\Users\keanu\Documents\Arduino\libraries\Adafruit_GFX_Library" "-IC:\Users\keanu\Documents\Arduino\libraries\MCUFRIEND_kbv" "C:\Users\keanu\AppData\Local\Temp\arduino_build_917559\sketch\tfterminal.ino.cpp" -o "C:\Users\keanu\AppData\Local\Temp\arduino_build_917559\preproc\ctags_target_for_gcc_minus_e.cpp" "C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\keanu\AppData\Local\Temp\arduino_build_917559\preproc\ctags_target_for_gcc_minus_e.cpp" Compiling sketch... "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10801 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "-IC:\Users\keanu\Documents\Arduino\libraries\Adafruit_GFX_Library" "-IC:\Users\keanu\Documents\Arduino\libraries\MCUFRIEND_kbv" "C:\Users\keanu\AppData\Local\Temp\arduino_build_917559\sketch\tfterminal.ino.cpp" -o "C:\Users\keanu\AppData\Local\Temp\arduino_build_917559\sketch\tfterminal.ino.cpp.o" tfterminal:20: error: 'INT16U' does not name a type

INT16U x=0;

^

tfterminal:21: error: 'INT16U' does not name a type

INT16U y=0;

^

C:\Users\keanu\Desktop\tfterminal\tfterminal\tfterminal.ino: In function 'void tftClearTerminal()':

tfterminal:28: error: 'Tft' was not declared in this scope

Tft.fillScreen(0, 230, 0, 320, BLACK);

^

C:\Users\keanu\Desktop\tfterminal\tfterminal\tfterminal.ino: In function 'void increase_Y()':

tfterminal:38: error: 'y' was not declared in this scope

if (++y>22)

     ^

tfterminal:42: error: 'x' was not declared in this scope

   x=y=0;      

   ^

C:\Users\keanu\Desktop\tfterminal\tfterminal\tfterminal.ino: In function 'void increase_X()':

tfterminal:52: error: 'x' was not declared in this scope

if (++x>31)

     ^

C:\Users\keanu\Desktop\tfterminal\tfterminal\tfterminal.ino: In function 'void tftPutchar(char)':

tfterminal:72: error: 'x' was not declared in this scope

 x=0;

 ^

tfterminal:78: error: 'Tft' was not declared in this scope

 Tft.drawString(string, x*10, 220-y*10, 1, WHITE, LANDSCAPE);

 ^

tfterminal:78: error: 'x' was not declared in this scope

 Tft.drawString(string, x*10, 220-y*10, 1, WHITE, LANDSCAPE);

                        ^

tfterminal:78: error: 'y' was not declared in this scope

 Tft.drawString(string, x*10, 220-y*10, 1, WHITE, LANDSCAPE);

                                  ^

tfterminal:78: error: 'LANDSCAPE' was not declared in this scope

 Tft.drawString(string, x*10, 220-y*10, 1, WHITE, LANDSCAPE);

                                                  ^

C:\Users\keanu\Desktop\tfterminal\tfterminal\tfterminal.ino: In function 'void tftDisplayHeader()':

tfterminal:86: error: 'Tft' was not declared in this scope

Tft.fillScreen(230, 240, 0, 320, BLUE);

^

tfterminal:87: error: 'LANDSCAPE' was not declared in this scope

Tft.drawString("TFTerminal - https://lucidar.me", 0, 230, 1, WHITE, LANDSCAPE);

                                                                   ^

C:\Users\keanu\Desktop\tfterminal\tfterminal\tfterminal.ino: In function 'void setup()':

tfterminal:95: error: 'TFT_BL_ON' was not declared in this scope

TFT_BL_ON;

^

tfterminal:98: error: 'Tft' was not declared in this scope

Tft.TFTinit();

^

Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI Using library Adafruit_GFX_Library at version 1.5.6 in folder: C:\Users\keanu\Documents\Arduino\libraries\Adafruit_GFX_Library Using library MCUFRIEND_kbv at version 2.9.8 in folder: C:\Users\keanu\Documents\Arduino\libraries\MCUFRIEND_kbv exit status 1 'INT16U' does not name a type

----------------------------------CODE------------------------------------

include

include // f.k. for Arduino-1.5.2

include "Adafruit_GFX.h"// Hardware-specific library

include

MCUFRIEND_kbv tft;

define BLACK 0x0000

define BLUE 0x001F

define RED 0xF800

define GREEN 0x07E0

define DARKGREEN 0x4720

define CYAN 0x07FF

define MAGENTA 0xF81F

define YELLOW 0xFFE0

define WHITE 0xFFFF

define DARKBROWN 0xDB80

define BROWN 0xF400

define PURPLE 0xC0DB

// Coordinates of the cursor INT16U x=0; INT16U y=0;

// Clear terminal void tftClearTerminal() {
// Display a black rectangle in the terminal body Tft.fillScreen(0, 230, 0, 320, BLACK);
}

// Increase Y (new line) // If cursor is at the bottom of the display, // Clear terminal to start a new page void increase_Y() { // Increase Y and check if last line if (++y>22) { // Clear terminal (new page) tftClearTerminal(); x=y=0;
} }

// Increase Y (next char) // If cursor is a end of line, // jump to a new line void increase_X() { // Increase X and check if end of line if (++x>31) { // New line x=0; increase_Y(); } }

// Display a char void tftPutchar(char c) { // Create an string for displaying the char char string[2]; string[0]=c; string[1]=0;

// New line ? if (c=='\n') { x=0; increase_Y(); } else { // Display char Tft.drawString(string, x10, 220-y10, 1, WHITE, LANDSCAPE); increase_X(); }
}

// Display terminal header (top blue banner) void tftDisplayHeader() { Tft.fillScreen(230, 240, 0, 320, BLUE); Tft.drawString("TFTerminal - https://lucidar.me", 0, 230, 1, WHITE, LANDSCAPE); }

void setup() { // Turn on the background light TFT_BL_ON;

// Init TFT library Tft.TFTinit();

// Display header and clear terminal tftDisplayHeader(); tftClearTerminal();

// Initialize USB serial Serial.begin(115200);

}

void loop() { // If a new char is available on serial link, // Display the char if (Serial.available()) { char c=Serial.read(); tftPutchar(c);

// Uncomment for echoing
//Serial.print(c);

} }

prenticedavid commented 4 years ago

Please run ALL the examples that come with the library. Report any examples by name if you have a problem. There is no need to paste the error report unless I ask you to.

Your sketch has many errors. You should always start with a working sketch that has the correct syntax.

This is the best place for library problems. The Arduino Displays forum is probably a better place for beginner questions.

David.

mokey808 commented 4 years ago

graphictest_kbv example im using the setup for the lcd on some code i found for a serial terminal using the ili9340 tft lcd im getting a error 'INT16U' does not name a type i have no clue what it is every example for the screen works but i try to use it in other stuff its a no go

prenticedavid commented 4 years ago

Go on. Does the graphictest_kbv example from the library work ?

I don't think that I have ever used 'INT16U'. If you have a link to working code, I will show you how to use it with MCUFRIEND_kbv i.e. post a link to the original code

The Arduino Displays forum is probably a better place for beginner questions. We can probably point you to examples, tutorials, advice, ...

David.

mokey808 commented 3 years ago

Sorry gave up on it

prenticedavid commented 3 years ago

It is fairly straightforward. Beginners should post in Arduino.cc/Displays Forum

  1. post a link to the actual display that you have bought.
  2. paste, attach or post a link to the original un-edited project code
  3. post a schematic or description of your wiring.

If the project uses common libraries and hardware, Forum readers will help you to "port" the original code.

And you will probably learn in the process.

David.