Quantcast
Channel: Support - Pimoroni Buccaneers
Viewing all articles
Browse latest Browse all 6932

Tips needed to speed up Pimoroni I2C display

$
0
0

@snaggle wrote:

I bought this display:

https://shop.pimoroni.com/products/i2c-graphical-lcd-128x64

It is a nice display to use, but is a little slow. Is there any way to speed it up?

My test code is below. To take 340 milli seconds to write 60 characters is quite a long time.

I already tried changing the I2C speed from 100k to 400k, and deleting the twi.o and wire.o files to force a recompile, but no change, so I guess the part that takes a long time is somewhere in the display or the display library.


#include <I2C_LCD.h>

I2C_LCD LCD;

byte I2C_LCD_ADDRESS = 0x51;

String line_1;
String line_2;
String line_3;
String line_4;
String line_1234;

unsigned long start = 0;
unsigned long finish = 0;
unsigned long total = 0;

void setup() {

Wire.begin();
LCD.CleanAll(WHITE);

}

void loop() {

line_1 = String("Time to");

do {
line_1 = String(" " + line_1);

} while (line_1.length() < 15);

line_2 = String("print a");

do {
line_2 = String(" " + line_2);

} while (line_2.length() < 15);

line_3 = String("string");

do {
line_3 = String(" " + line_3);

} while (line_3.length() < 15);

line_4 = String(total);

line_4 = String(line_4 + " milli sec");

do {
line_4 = String(" " + line_4);

} while (line_4.length() < 15);

line_1234 = String(line_1 + line_2 + line_3 + line_4);

LCD.FontModeConf(Font_8x16_1, FM_ANL_AAA, BLACK_BAC);

LCD.CharGotoXY(0, 0);

start = millis();

LCD.println(line_1234);

finish = millis();

total = finish - start;

}

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6932

Trending Articles