zinggjm / ili9486_spi Goto Github PK
View Code? Open in Web Editor NEWILI9486_SPI for Arduino
License: GNU General Public License v3.0
ILI9486_SPI for Arduino
License: GNU General Public License v3.0
Hello
I bought the 8 pin version
What changes do I need to make to make it work with your codes?
PIN Definition:
1-GND
2-VCC
3-CLX
4-MOSI
5-RES
6-DC
7-BLK
8-MISO
Hello Jean,
I am using your library for 2.8 inch tft display and i have an issue with my text beacuse it keeps getting mirrored. I tried to change writeCommand and wrtieData functions but the problem is that these functions are private in your library and I can't use them in my arduino code. I am just asking you if there is an easy sollution to this, maybe you can make these functions public or something, but I am no expert in coding with C so I don't know what can be done. Thank you for any help in advance.
Hi,
I tried to compile a short test-program to test a Waveshare 4inch TFT Touch Shield Display on a Arduino Due.
IDE: Arduino 1.8.12
Code like this:
#include <SPI.h>
#include "ILI9486_SPI.h"
ILI9486_SPI tft(/CS=10/ 10, /DC=/ 7, /RST=/ 8);
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
void setup() {
// put your setup code here, to run once:
tft.init();
tft.fillScreen(RED);
}
void loop() {
// put your main code here, to run repeatedly:
for (uint8_t r = 0; r < 4; r++)
{
//Serial.print("rotation "); Serial.println(r);
tft.setRotation(r);
tft.fillScreen(BLACK);
tft.setCursor(0, 0);
tft.setTextColor(RED, BLACK);
tft.setTextSize(1);
tft.println("Hello World!");
tft.println(01234.56789, 2);
tft.println(0xDEADBEF, HEX);
tft.setTextColor(GREEN);
tft.setTextSize(2);
tft.println("Hello");
tft.println(01234.56789, 2);
tft.println(0xDEADBEF, HEX);
tft.setTextColor(BLUE);
tft.setTextSize(3);
tft.println("Hello");
tft.println(01234.56789, 2);
tft.println(0xDEADBEF, HEX);
//Serial.print("rotation "); Serial.print(r); Serial.println(" done");
delay(5000);
}
}
Error-Message:
Arduino: 1.8.12 (Windows 10), Board: "Arduino Due (Programming Port)"
C:\Users\Bernie\Documents\Arduino\libraries\ILI9486_SPI-master\src\ILI9486_SPI.cpp: In constructor 'ILI9486_SPI::ILI9486_SPI(int8_t, int8_t, int8_t)':
C:\Users\Bernie\Documents\Arduino\libraries\ILI9486_SPI-master\src\ILI9486_SPI.cpp:44:9: error: assignment of read-only member 'Adafruit_GFX::WIDTH'
WIDTH = 320;
^
C:\Users\Bernie\Documents\Arduino\libraries\ILI9486_SPI-master\src\ILI9486_SPI.cpp:45:10: error: assignment of read-only member 'Adafruit_GFX::HEIGHT'
HEIGHT = 480;
^
C:\Users\Bernie\Documents\Arduino\libraries\ILI9486_SPI-master\src\ILI9486_SPI.cpp: In member function 'void ILI9486_SPI::_setWindow(uint16_t, uint16_t, uint16_t, uint16_t)':
C:\Users\Bernie\Documents\Arduino\libraries\ILI9486_SPI-master\src\ILI9486_SPI.cpp:409:29: warning: narrowing conversion of '(((int)x) >> 8)' from 'int' to 'uint16_t {aka short unsigned int}' inside { } [-Wnarrowing]
uint16_t columns[] = {x >> 8, x & 0xFF, xe >> 8, xe & 0xFF};
^
C:\Users\Bernie\Documents\Arduino\libraries\ILI9486_SPI-master\src\ILI9486_SPI.cpp:409:37: warning: narrowing conversion of '(((int)x) & 255)' from 'int' to 'uint16_t {aka short unsigned int}' inside { } [-Wnarrowing]
uint16_t columns[] = {x >> 8, x & 0xFF, xe >> 8, xe & 0xFF};
^
C:\Users\Bernie\Documents\Arduino\libraries\ILI9486_SPI-master\src\ILI9486_SPI.cpp:409:48: warning: narrowing conversion of '(((int)xe) >> 8)' from 'int' to 'uint16_t {aka short unsigned int}' inside { } [-Wnarrowing]
uint16_t columns[] = {x >> 8, x & 0xFF, xe >> 8, xe & 0xFF};
^
C:\Users\Bernie\Documents\Arduino\libraries\ILI9486_SPI-master\src\ILI9486_SPI.cpp:409:57: warning: narrowing conversion of '(((int)xe) & 255)' from 'int' to 'uint16_t {aka short unsigned int}' inside { } [-Wnarrowing]
uint16_t columns[] = {x >> 8, x & 0xFF, xe >> 8, xe & 0xFF};
^
C:\Users\Bernie\Documents\Arduino\libraries\ILI9486_SPI-master\src\ILI9486_SPI.cpp:412:26: warning: narrowing conversion of '(((int)y) >> 8)' from 'int' to 'uint16_t {aka short unsigned int}' inside { } [-Wnarrowing]
uint16_t rows[] = {y >> 8, y & 0xFF, ye >> 8, ye & 0xFF};
^
C:\Users\Bernie\Documents\Arduino\libraries\ILI9486_SPI-master\src\ILI9486_SPI.cpp:412:34: warning: narrowing conversion of '(((int)y) & 255)' from 'int' to 'uint16_t {aka short unsigned int}' inside { } [-Wnarrowing]
uint16_t rows[] = {y >> 8, y & 0xFF, ye >> 8, ye & 0xFF};
^
C:\Users\Bernie\Documents\Arduino\libraries\ILI9486_SPI-master\src\ILI9486_SPI.cpp:412:45: warning: narrowing conversion of '(((int)ye) >> 8)' from 'int' to 'uint16_t {aka short unsigned int}' inside { } [-Wnarrowing]
uint16_t rows[] = {y >> 8, y & 0xFF, ye >> 8, ye & 0xFF};
^
C:\Users\Bernie\Documents\Arduino\libraries\ILI9486_SPI-master\src\ILI9486_SPI.cpp:412:54: warning: narrowing conversion of '(((int)ye) & 255)' from 'int' to 'uint16_t {aka short unsigned int}' inside { } [-Wnarrowing]
uint16_t rows[] = {y >> 8, y & 0xFF, ye >> 8, ye & 0xFF};
^
exit status 1
Fehler beim Kompilieren für das Board Arduino Due (Programming Port).
Any Idea, what's wrong? Thank's for help, Bernie
Hallo,
Sorry, this is not a PROBLEM on your library!! But only a suggestion request.
I have spent a lot of time with the Waveshare library for my 4inch RPI display without any results, but finaly I have find you ILI9486_SPI library, very easy to use.
But I'd like to use also the "touch" feature.
Have you any idea?
Waveshare hat me answered:
"This model is designed for Raspberry Pi, as well as the touch driver. It is difficult to compatible with Arduino or ESP32.
We suggest that you can try to use this model which is compatible with Arduino: .......link....."
But I don't want to buy another display.
Thanks for any help. And sorry for my english.
Roberto
Graz (Austria)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.