ILI9341 + davega-v0.4 on Arduino nano

Hi,

I want to integrate the Adafruit_ILI9341 driver instead of ILI9225
in a davega-v0.4 program to use a 2.8" 240x320 TFT screen with arduino nano.

This is a programmable speedometer for VESC. (electric scooter controller and

others)
My project: Free Transfert - Service d'envoi de fichiers

Where

Source code davega:

Driver Adafruit_ILI9341 source code:

I would like to know what code to modify in the "davega" program.

Thanks

Since you have the original code try modifying it yourself. Start by having one work and then go through the code so you understand it. Check your pinouts etc. Draw a schematic,not a frizzy picture. At that point you should be in a great spot to make the exchange.

Okay, frankly I really don't know where to start but let's go there ..

Files program

Screen pin

ILI9341 TFT	Nano RP2040 Connect
-------------------------------
VCC		3V3
GND		GND
CS		D10
RESET		RESET
DC		D9
SDI(MOSI)	D11 (SPI0 TX)
SCK		D13 (SPI0 SCK)
LED		3V3
SDA(MISO)	D12 (SPI0 RX)

The first file I found interesting :
davega_ili9225_screen.cpp

#include "davega_ili9225_screen.h"

#define TFT_RST 12
#define TFT_RS 9
#define TFT_CS 10 // SS
#define TFT_SDI 11 // MOSI
#define TFT_CLK 13 // SCK
#define TFT_LED 0

TFT_22_ILI9225 tft = TFT_22_ILI9225(TFT_RST, TFT_RS, TFT_CS, TFT_LED, 200);
TFT_22_ILI9225* p_tft = nullptr;

void DavegaILI9225Screen::init(t_davega_screen_config *config) {
DavegaScreen::init(config);
if (!p_tft) {
p_tft = &tft;
p_tft->begin();
p_tft->setOrientation(config->orientation);
p_tft->setBackgroundColor(COLOR_BLACK);
}
_tft = p_tft;
}

TFT_22_ILI9225* get_tft_22_ili9225()
{
return p_tft;
}

and :
davega_ili9225_screen.h

#ifndef DAVEGA_ILI9225_SCREEN_H
#define DAVEGA_ILI9225_SCREEN_H

#include "davega_screen.h"
#include <TFT_22_ILI9225.h>

class DavegaILI9225Screen: public DavegaScreen {
public:
void init(t_davega_screen_config* config) override;

protected:
TFT_22_ILI9225* _tft;
};

TFT_22_ILI9225* get_tft_22_ili9225();

#endif //DAVEGA_ILI9225_H

I think I can replace these 2 files

davega_ili9225_screen.cpp
davega_ili9225_screen.h
TFT_22_ILI9225.h

by

Adafruit_ILI9341.cpp
Adafruit_ILI9341.h
Adafruit_ILI9341.h (not sure)

Then rename in each line of program code
the name of the new driver

Sorry I cannot follow the frizzy picture.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.