Hello,
I try to connect a TFT display on my Wifi REV2 board.
I have following this guide : Guide to 1.8 TFT Display with Arduino | Random Nerd Tutorials
But nothing works, just a white screen.
Someone success to connect tft on wifi uno rev2 board ?
Thanks for your help.
David
Post the code you used, using code tags, even if it's the same as the tutorial.
Also, post a schematic, even if it's hand drawn.
pinout is the following:
and the code is :
/*
* Rui Santos
* Complete Project Details https://randomnerdtutorials.com
*/
// include TFT and SPI libraries
#include <TFT.h>
#include <SPI.h>
// pin definition for Arduino UNO
#define cs 10
#define dc 9
#define rst 8
// create an instance of the library
TFT TFTscreen = TFT(cs, dc, rst);
void setup() {
//initialize the library
TFTscreen.begin();
// clear the screen with a black background
TFTscreen.background(0, 0, 0);
//set the text size
TFTscreen.setTextSize(2);
}
void loop() {
//generate a random color
int redRandom = random(0, 255);
int greenRandom = random (0, 255);
int blueRandom = random (0, 255);
// set a random font color
TFTscreen.stroke(redRandom, greenRandom, blueRandom);
// print Hello, World! in the middle of the screen
TFTscreen.text("Hello, World!", 6, 57);
// wait 200 miliseconds until change to next color
delay(200);
}
Not behind a PC at the moment to check. Please compare the pinouts of your board with that of an Uno; I suspect that the SPI interface is not on pins 11 .. 13.
I have checked pinouts and I only see SDA, not SCK ...
- MOSI − 11 or ICSP-4
- MISO − 12 or ICSP-1
- SCK − 13 or ICSP-3
- SS − 10
It looks like you are confusing the I2C interface (SDA, SCK) with the SPI interface (MOSI, etc.).
Post a link to the TFT, and state which interface you plan to wire up and use.
I use this TFT :
I prefer to ICSP connector.
I would like use this TFT to display wifi connection status and some other information.
It works great with Uno R3 :
It is only shown on the "Full Pinout" version of the pinout diagram, which can be downloaded from the "Resources" section of the Arduino Uno WiFi Rev2 documentation page:
https://docs.arduino.cc/hardware/uno-wifi-rev2#resources
Unlike the Uno, the SPI bus of the Uno WiFi Rev2 is only available on the ICSP header, as mentioned in the "Getting Started" page:
https://www.arduino.cc/en/Guide/ArduinoUnoWiFiRev2#spi
The SPI interface is available on the ICSP connector>
Although it is unfortunate that this difference has not been communicated to the users more clearly, there is an important benefit to this difference. The benefit is that pins 11-13 are still available for use as normal digital pins even when you have something connected to the SPI bus on the Uno WiFi Rev2. With the Uno, those 3 pins can only be used for the SPI devices when the bus is in use.
I suppose I must change Pin Definition ? In the TFT example I see :
For UNO
#define cs 10
#define dc 9
#define rst 8
// pin definition for the Leonardo
// #define cs 7
// #define dc 0
// #define rst 1
You should set those to whichever pins you are using for those connections to the TFT. If you are using pins 10, 8, and 9 then there is no need to change them.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.