Загрузка страницы

2.4" ILI9341 based TFT LCD with Arduino - fast library speed comparison

Driven by Arduino Pro Mini clone with ATmega 328 @ 3.3V 8MHz.

Simple test to see how fast and usable the screen is using different libraries. Please note that whole screen is updated every time (see code below).

After filming I modified the sketch to capture micros() function before and after screen refresh. Results for that are:
Adafruit library: 1048ms
Modified Adafruit library: 785 ms
PDQ: 323 ms

In real life application you shouldn't update whole screen content every time something changes. I changed the sketch to refresh only three main values of V, A and W (biggest digits). Test results for that are:
Adafruit library: 401ms
Modified Adafruit library: 338 ms
PDQ: 141 ms

Arduino data was later verified by hooking oscilloscope to a CS line.

Libraries used:
Original Adafruit ILI9341 lib
https://github.com/adafruit/Adafruit-GFX-Library
https://github.com/adafruit/Adafruit_ILI9341

Modified Adafruit ILI9341 lib
https://www.youtube.com/watch?v=9RIKzXANbOY
http://forum.arduino.cc/index.php?topic=181679.msg1896208#msg1896208

PDQ_GFX ILI9341 lib
https://hackaday.io/project/6038-pdqgfx-optimzed-avr-lcd-graphics
CODE:

#include "SPI.h"

// Original Adafruit lib
/*/
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#define TFT_DC 9
#define TFT_CS 10
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
#define libName "Adafruit library"
//*/

// Updated Adafruit lib
/*/
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341_fast.h"
Adafruit_ILI9341 tft = Adafruit_ILI9341();
#define libName "modified Adafruit lib"
//*/

// PDQ_GFX
//*/
#include "PDQ_GFX.h"
#include "PDQ_ILI9341_config.h"
#include "PDQ_ILI9341.h"
PDQ_ILI9341 tft;
#define libName "PDQ_GFX library"
//*/

float volts = 12.345;
float amps = 1.234;
float watts = 0.0;

void setup() {
tft.begin();
tft.setRotation(1);
tft.fillScreen(ILI9341_WHITE);

tft.setTextColor(ILI9341_BLACK, ILI9341_WHITE);

tft.setTextSize(2);
tft.setCursor(20, 46);
tft.println(libName);

delay(2500);

tft.fillScreen(ILI9341_WHITE);
}

void loop(void) {
volts += 0.001;
amps += 0.001;
watts = volts * amps;

tft.setTextSize(5);
tft.setCursor(20, 10);
tft.print(volts, 3);
tft.setTextSize(3);
tft.setCursor(204, 24);
tft.println("V");
tft.setTextSize(5);
tft.setCursor(20, 60);
tft.print(" ");
tft.print(amps, 3);
tft.setTextSize(3);
tft.setCursor(204, 74);
tft.println("A");
tft.setTextSize(5);
tft.setCursor(20, 110);
tft.print(watts, 3);
tft.setTextSize(3);
tft.setCursor(204, 124);
tft.println("W");

tft.setTextSize(2);
tft.setCursor(20, 158);
tft.print("SET ");
tft.print(volts, 3);
tft.println(" V");
tft.setCursor(20,178);
tft.print(" ");
tft.print(amps, 3);
tft.println(" A");

tft.setTextSize(2);
tft.setCursor(20, 198);
tft.print("LIMIT ");
tft.print(24.000, 3);
tft.println(" V");
tft.setCursor(20,218);
tft.print(" ");
tft.print(2.000, 3);
tft.println(" A");

delay(200);
}

Видео 2.4" ILI9341 based TFT LCD with Arduino - fast library speed comparison канала K
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
19 октября 2015 г. 3:13:21
00:02:04
Другие видео канала
VW GTI mk6 - worn out front control arm bushingVW GTI mk6 - worn out front control arm bushing
Яндекс.Метрика