I started learning Arduino and I bought a kit. Now I want to connect this LCD module
to
https://www.optimusdigital.ro/ro/compatibile-cu-arduino-pro-mini/72-placa-de-dezvoltare-compatibila-cu-arduino-pro-mini.html
In the first link, there is a scheme for connecting the LCD to the Pro Mini. I'm using this example but it doesn't work, the LCD is just blank:
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <TFT_ILI9163C.h>
// Color definitions
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
/*
Teensy3.x and Arduino's
You are using 4 wire SPI here, so:
MOSI: 11//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site)
MISO: 12//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site)
SCK: 13//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site)
the rest of pin below:
*/
#define __CS 10
#define __DC 9
/*
Teensy 3.x can use: 2,6,9,10,15,20,21,22,23
Arduino's 8 bit: any
DUE: check arduino site
If you do not use reset, tie it to +3V3
*/
TFT_ILI9163C tft = TFT_ILI9163C(__CS, __DC);
void setup() {
tft.begin();
}
void loop(){
testLines(random(0x00ff,0xffff));
delay(100);
testText();
delay(500);
}
unsigned long testText() {
tft.fillScreen();
unsigned long start = micros();
tft.setCursor(0, 0);
tft.setTextColor(WHITE);
tft.setTextSize(1);
tft.println("Hello World!");
tft.setTextColor(YELLOW);
tft.setTextSize(2);
tft.println(1234.56);
tft.setTextColor(RED);
tft.setTextSize(3);
tft.println(0xDEAD, HEX);
tft.println();
tft.setTextColor(GREEN);
tft.setTextSize(4);
tft.println("Hello");
return micros() - start;
}
unsigned long testLines(uint16_t color) {
tft.fillScreen();
unsigned long start, t;
int x1, y1, x2, y2,
w = tft.width(),
h = tft.height();
tft.fillScreen();
x1 = y1 = 0;
y2 = h - 1;
start = micros();
for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
x2 = w - 1;
for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
t = micros() - start; // fillScreen doesn't count against timing
tft.fillScreen();
x1 = w - 1;
y1 = 0;
y2 = h - 1;
start = micros();
for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
x2 = 0;
for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
t += micros() - start;
tft.fillScreen();
x1 = 0;
y1 = h - 1;
y2 = 0;
start = micros();
for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
x2 = w - 1;
for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
t += micros() - start;
tft.fillScreen();
x1 = w - 1;
y1 = h - 1;
y2 = 0;
start = micros();
for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
x2 = 0;
for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
return micros() - start;
}
So I suppose the scheme in the first link uses another pins than the code above.
So, how should I connect it?
I connected it like this and it doesn't show the test like in the code:
LED - + on breadboard
SCK - 13 pin on pro mini
SDA - 11 pin on pro mini
A0 - 9 pin on pro mini
CS - 10 pin on pro mini
RESET - none
GND - - on breadboard
VCC - none
It does power up, but it is blank. What am I doing wrong?
EDIT: Wrong forum, sorry. I should've posted it in DISPLAYS. This is for LEDs not LCDs. Sorry.