Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO and ILI9341 Display for Drawing Lines

View and Edit Project In Cirkit DesignerImage of Arduino UNO and ILI9341 Display for Drawing Lines

Circuit Documentation

Summary

This circuit involves an Arduino UNO microcontroller interfacing with an ILI9341 TFT display. The Arduino UNO is used to control the display, sending commands and data to render graphics on the screen. The connections between the Arduino and the display are established through various digital pins, enabling communication via the SPI protocol.

Component List

  1. ILI9341 TFT Display

    • Description: A 240x320 pixel TFT LCD display with SPI interface.
    • Pins: VCC, GND, CS, RST, D/C, MOSI, SCK, LED, MISO
  2. Arduino UNO

    • Description: A microcontroller board based on the ATmega328P.
    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0

Wiring Details

ILI9341 TFT Display

Arduino UNO

Code Documentation

Code Overview

The provided code initializes the ILI9341 display and sets up basic drawing functions. The setup function initializes the display and sets its rotation. It also sets the color and draws a line on the display. The loop function is currently empty but can be used for continuous operations. The sendCommand function is a helper to send commands to the display.

Code Listing

#include "lcdgfx.h"

DisplayILI9341_240x320x16_SPI display(3,{-1, 4, 5, 0,-1,-1});

void setup()
{
    display.begin();
    display.getInterface().setRotation(0); // Set rotation to 0

    // Memory Access Control command to set RGB mode
    // sendCommand(0x36, 0x00); // 0x00 sets the display to RGB mode

    display.setColor(RGB_COLOR16(255,0,0));

    // display.putPixel(0, 0);
    display.drawLine(10,30,56,96);
}

void loop()
{
    // display.setColor(RGB_COLOR16(255,255,0));
    // display.drawLine(10,30,56,96);
}

void sendCommand(uint8_t command, uint8_t data)
{
    display.getInterface().startTransaction();
    display.getInterface().sendCommand(command);
    display.getInterface().sendData(data);
    display.getInterface().endTransaction();
}

Code Explanation

This documentation provides a comprehensive overview of the circuit, including the components used, their connections, and the code to operate the display.