Pages: [1]   Go Down
Author Topic: DUE compatible library for SPI TFT LCD module  (Read 1184 times)
0 Members and 1 Guest are viewing this topic.
Sydney
Offline Offline
Full Member
***
Karma: 1
Posts: 108
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have been working on MultiLCD, an Arduino library that supports easy text displaying and bitmap drawing on several display modules (LCD/OLED/TFT). Recently I've made it working on Arduino DUE and added support for ILI9341, controller for some SPI TFT LCD modules.

The library code is hosted on github.

The demo sketch is like this:
Code:
#include <Wire.h>
#include <SPI.h>
#include <MultiLCD.h>

LCD_ILI9341 lcd; /* for 2.2" SPI TFT module */

static const PROGMEM uint8_t smile[48 * 48 / 8] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0xF0,0xF8,0xF8,0xFC,0xFC,0xFE,0xFE,0x7E,0x7F,0x7F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x7F,0x7F,0x7E,0xFE,0xFE,0xFC,0xFC,0xF8,0xF8,0xF0,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xC0,0xF0,0xFC,0xFE,0xFF,0xFF,0xFF,0x3F,0x1F,0x0F,0x07,0x03,0x01,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x01,0x03,0x07,0x0F,0x1F,0x3F,0xFF,0xFF,0xFF,0xFE,0xFC,0xF0,0xC0,0x00,
0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x1F,0x1F,0x1F,0x3F,0x1F,0x1F,0x02,0x00,0x00,0x00,0x00,0x06,0x1F,0x1F,0x1F,0x3F,0x1F,0x1F,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,
0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x00,0x00,0x30,0xF8,0xF8,0xF8,0xF8,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0xF8,0xF8,0xFC,0xF8,0x30,0x00,0x00,0xE0,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,
0x00,0x03,0x0F,0x3F,0x7F,0xFF,0xFF,0xFF,0xFC,0xF8,0xF0,0xE1,0xC7,0x87,0x0F,0x1F,0x3F,0x3F,0x3E,0x7E,0x7C,0x7C,0x7C,0x78,0x78,0x7C,0x7C,0x7C,0x7E,0x3E,0x3F,0x3F,0x1F,0x0F,0x87,0xC7,0xE1,0xF0,0xF8,0xFC,0xFF,0xFF,0xFF,0x7F,0x3F,0x0F,0x03,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x07,0x0F,0x1F,0x1F,0x3F,0x3F,0x7F,0x7F,0x7E,0xFE,0xFE,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFE,0xFE,0x7E,0x7F,0x7F,0x3F,0x3F,0x1F,0x1F,0x0F,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
};

void setup()
{
lcd.begin();
}

void loop()
{
lcd.backlight(false);

lcd.clear();
lcd.setTextColor(255, 255, 0);
lcd.draw(smile, 0, 0, 48, 48);

lcd.setTextColor(255, 255, 255);
lcd.setCursor(0, 10);
lcd.setFont(FONT_SIZE_SMALL);
lcd.print("Hello, world!");

lcd.setTextColor(255, 0, 255);
lcd.setCursor(0, 11);
lcd.setFont(FONT_SIZE_MEDIUM);
lcd.print("Hello, world!");

lcd.setTextColor(255, 0, 0);
lcd.setCursor(0, 13);
lcd.setFont(FONT_SIZE_SMALL);
lcd.printLong(1234567890);

lcd.setTextColor(0, 255, 0);
lcd.setCursor(0, 14);
lcd.setFont(FONT_SIZE_MEDIUM);
lcd.printLong(1234567890);

lcd.setTextColor(0, 0, 255);
lcd.setCursor(0, 16);
lcd.setFont(FONT_SIZE_LARGE);
lcd.printLong(12345678);

lcd.setTextColor(0, 255, 255);
lcd.setCursor(0, 18);
lcd.setFont(FONT_SIZE_XLARGE);
lcd.printLong(12345678);

lcd.backlight(true);

delay(10000);
}


* IMG_6641.JPG (146.48 KB, 1024x630 - viewed 110 times.)
Logged


Laguna Hills, CA 92653
Offline Offline
Full Member
***
Karma: 0
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Very nice work.
Thanks for sharing.

The all electric vehicles, like the Nissan LEAF,
are not subject to the smog-related regulations,
so they tend to have proprietary OBD interfaces.

The LEAF has 3 CAN buses on its OBD connector, one
similar to the CAR CAN bus, one for the EV related
functions, and a less important AV CAN bus.

Additionally, the LEAF has a 4th CAN bus, which does
not appear on the OBD connector, used for Quick-Charging
(QC) the vehicle.

Most of our work is in this sub-forum:
http://www.mynissanleaf.com/viewforum.php?f=44

I am working on a Due-based controller for a mini-QC
device.

Again, thanks for sharing your nice work.
Logged

Cheers, Gary
Due for controlling Electric car charging.
Nissan LEAF - Mini Quick Charge (mQC)

Laguna Hills, CA 92653
Offline Offline
Full Member
***
Karma: 0
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Does the UTFT library support the bitmap functions?

Does it support these display types?
Logged

Cheers, Gary
Due for controlling Electric car charging.
Nissan LEAF - Mini Quick Charge (mQC)

Pages: [1]   Go Up
Jump to: