I know this has probably been covered, but for the life of me I can not get any suggestions to work. I have an ESP32 DEVKITV1 to an ILI9341, and all I can get is the backlight to light the screen. I can not get any color or text to display at all. Please tell me where I am screwing up.
# SPI per ILI9341 table (MOSI=GPIO23, SCK=GPIO18)
spi:
id: spihwd
clk_pin: GPIO18
mosi_pin: GPIO23
# MISO is not used/not connected on your module
interface: hardware
# Define a PWM output on the ESP32
output:
- platform: ledc
pin: GPIO27
#inverted: true
id: gpio_27_backlight_pwm
# Define a monochromatic, dimmable light for the backlight
light:
- platform: monochromatic
output: gpio_27_backlight_pwm
name: "Display Backlight"
id: back_light
restore_mode: ALWAYS_ON
# Colors & fonts unchanged
color:
- id: my_red
red: 100%
green: 0%
blue: 0%
- id: my_orange
red: 100%
green: 50%
blue: 0%
- id: my_yellow
red: 100%
green: 100%
blue: 0%
- id: my_green
red: 0%
green: 100%
blue: 0%
- id: my_blue
red: 0%
green: 0%
blue: 100%
- id: my_teal
red: 0%
green: 100%
blue: 100%
- id: my_gray
red: 70%
green: 70%
blue: 70%
- id: my_white
red: 100%
green: 100%
blue: 100%
- id: my_black
red: 0%
green: 0%
blue: 0%
font:
- file: "gfonts://Roboto"
id: font_48
size: 48
- file: "gfonts://Roboto"
id: font_36
size: 36
- file: "gfonts://Roboto"
id: font_24
size: 24
- file: "gfonts://Roboto"
id: font_12
size: 12
# --- ILI9341 DISPLAY ---
display:
- platform: ili9xxx
model: TFT 2.4
spi_id: spihwd
color_palette: 8BIT
#color_order: RGB
#cs_pin: GPIO15
dc_pin: GPIO2
reset_pin: GPIO13
invert_colors: false
#show_test_card: true
update_interval: 2s
lambda: |-
const int W = it.get_width();
const int H = it.get_height();
it.fill(Color::BLACK);
// White border
it.rectangle(0, 0, W, H, id(my_white));
// Color bars (using RGB constructor)
it.filled_rectangle(0, 0, W/3, H, Color(1.0, 0.0, 0.0)); // Red
it.filled_rectangle(W/3, 0, W/3, H, Color(0.0, 1.0, 0.0)); // Green
it.filled_rectangle(2*W/3, 0, W - 2*W/3, H, Color(0.0, 0.0, 1.0)); // Blue
// Text on top
it.print(8, 8, id(font_24), id(my_white), "ILI9341 TEST");