Skip to content

Instantly share code, notes, and snippets.

@calogerus
calogerus / ILI9341_1.ino
Last active January 9, 2024 21:46
Arduino UNO + 2.4 TFT-LCD-Display-Shield-Touch-Panel-ILI9341-240x320-for-Arduino-UNO-MEGA
void LCD_write(uint8_t d) {
// ILI9341 reads data pins when WR rises from LOW to HIGH (A1 pin on arduino)
PORTC = PORTC & B11111101; // WR 0
// data pins of ILI9341 connected to two arduino ports
PORTD = (PORTD & B00000011) | ((d) & B11111100);
PORTB = (PORTB & B11111100) | ((d) & B00000011);
PORTC = PORTC | B00000010; // WR 1
}