Jump to content
Rei Vilo

[Energia Library] LCD_screen Library Suite

Recommended Posts

Welcome to Energia!

 

To use the example:

  • For the LCD22_Touch_main.zip package, just unzip it and double-click on LCD22_Touch_main.ino.

Now, if you want to use it as a library:

  • The first time you run Energia, it creates a folder called Energia with a sub-folder called libraries or Libraries.
  • Just place the folder with the library inside, to obtain Energia/libraries/LCD22_Touch_main.
  • Either
    • Delete the LCD22_Touch_main.ino
  • or
    • Create a folder Energia/libraries/LCD22_Touch_main/examples/LCD22_Touch_main and
    • Move LCD22_Touch_main.ino inside.

post-12238-0-22546700-1409159516_thumb.png

post-12238-0-53406600-1409159895_thumb.png

post-12238-0-01392900-1409159901_thumb.png

Share this post


Link to post
Share on other sites

This is weird.  I have tried several Energia libraries for Rob's LCD on a Stellaris Launchpad (earlier version?):

 

(1) LCD_Distribution105_2 works -- except touch is wonky.  This has four demos: LCDExampleWITHCLOCK, LCDExampleWITHGAUGE, LCDExampleWITHHISTOGRAM and LCDExampleWITHTOUCH.  

 

(2) LCD_Distribution107_2 doesn't work.  (this is where LCD22_Touch_main.ino is).  It compiles and appears to load but just freezes.  

 

(3) Rei Vilo's 'Library113' (Distribution-2) freezes.  

 

(3) ReiVilo's latest Beta122 gives me this error:
 "LCD_screen_font.cpp.o: In function `LCD_screen_virtual::LCD_screen_virtual()':

  LCD_screen_virtual.h:46: undefined reference to `vtable for LCD_screen_virtual'
  collect2: error: ld returned 1 exit status"

... and I do not know how to fix it.  

 

Thanks,

David

Share this post


Link to post
Share on other sites

Only the very first batch of this BP had different pin-out (do not confuse with board marked as v1.)

All current boards (v1-v4,) have the same pin-out and do work with D107 library without any changes.

Share this post


Link to post
Share on other sites

Umm, now I am having trouble even uploading to the Stellaris after trying some of the libraries.  Is there some way to resurrect my Stellaris Laundhpads?

David

Share this post


Link to post
Share on other sites

@@Rei Vilo - Can you fix the case sensitivity issues present in the various files?

 

Under Linux case sensitivity is mandatory, so the library refuses to compile due to:

 

#include "spi.h" in a lot of the .h files (it's SPI.h, not spi.h)

 

Many of the Screen_XYZ.cpp files include their .h as "screen_XYZ.h", rather than "Screen_XYZ.h" as it should be.

After redoing all those mistakes I have a new Screen_ILI9341.cpp and clock example that compiles (haven't loaded it onto an MCU yet ....... so we're at that precious "hope & pray" stage ;-) )

 

Also I noticed release 113 lists the versions wrong, with LCD_SCREEN_RELEASE 110 and LCD_SCREEN_FONT release 112 :)

Share this post


Link to post
Share on other sites

Screen_ILI9341.cpp / .h for the 2.2" ILI9341 TFT displays accessible over SPI found cheap at Aliexpress, eBay et al, example link - http://www.aliexpress.com/item/New-2-2-inch-2-2-240x320-SPI-TFT-LCD-Display-Module-ILI9341-PCB-5V-3/32237378199.html (search "ili9341 2.2")

 

 

Hardware SPI is the only one supported, no setModule() type of stuff supported either yet.  Wanted to simplify the begin() routine since it's my first dip into LCD_screen.

 

Features supported above and beyond typical LCD_screen:

Sleep - setSleep(true/false), which also controls the backlight

Invert - setInvert(true/false)

 

Initializer syntax:

    Screen_ILI9341(uint8_t pinScreenChipSelect,
                 uint8_t pinScreenDataCommand,
                 uint8_t pinScreenBacklight,
                 uint8_t pinScreenReset=NULL);
 

Currently setOrientation() hasn't been tested, it works in Portrait mode on my display (240 width, 320 height) with setOrientation(0).  The MADCTL register had to be tweaked to flip-flop X coordinates because they appear to be backwards with the way this display is internally wired.

 

There is no touch digitizer on this screen so my code doesn't include any touch support.  There is an SD card slot, but I haven't played with it yet.

 

Pics:

post-15991-0-97669500-1420480617_thumb.jpg

 

post-15991-0-43522900-1420480623_thumb.jpg

(^ invert mode)

Share this post


Link to post
Share on other sites

Thank you for the comments.

 

Unfortunately, the SPI library is sometimes spi.h and sometimes SPI.h, depending on the platform.

 

The library has gone through heavy work for another project, so I haven't released an updated version for a long time now.

 

Let's hope to have some time available to work on it!

 

@@spirilis How many lines of code for the clock?

Share this post


Link to post
Share on other sites

Thank you for the comments.

 

Unfortunately, the SPI library is sometimes spi.h and sometimes SPI.h, depending on the platform.

 

The library has gone through heavy work for another project, so I haven't released an updated version for a long time now.

 

Let's hope to have some time available to work on it!

 

@@spirilis How many lines of code for the clock?

It's not a real clock, but the amount of code regardless was infinitesimal!

#include <SPI.h>
#include <LCD_screen_font.h>
#include <Screen_ILI9341.h>
#include <LCD_GUI.h>
#include <LCD_graphics.h>

Screen_ILI9341 myLCD(13, 33, 31, 32);
gClock myClock;

void setup()
{
  int i;
  
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.println("LCD init-");
  myLCD.begin();
  Serial.println("Defining clock-");
  myClock.define(&myLCD, 120, 120, 60);
  
  myLCD.line(0, 0, 100, 100, whiteColour);
}

void loop()
{
  //return;
  // put your main code here, to run repeatedly:
  static unsigned int minute = 0;
  
  Serial.print("Drawing time: 4, "); Serial.print(minute); Serial.println(", 0, \"LCD test!\"");
  myClock.draw(4, minute++, 0, "LCD test!");
  delay(2000);
  if (minute % 5 == 1)
    myLCD.setSleep(true);
  else
    myLCD.setSleep(false);
}

Seriously myClock.define() and myClock.draw() is all there is to it.  And plenty of customization can be had in the options to define().  Great design!

Share this post


Link to post
Share on other sites

The LCD_screen Library Suite release 225 supports a wide selection of screens on different platforms, including Energia, Teensy and Arduino.

  • Screen_ER1963 and Screen_ER1963_SD
  • Screen_ER8875 and Screen_ER8875_SD
  • Screen_HI32
  • Screen_HX8353E
  • Screen_HY28A
  • Screen_HY28A_SRAM
  • Screen_ILI9225B
  • Screen_ILI9340
  • Screen_K35
  • Screen_K35_SPI
  • Screen_K70
  • Screen_PICadillo
  • Screen_PicasoSGC
  • Screen_PicasoSPE
  • Screen_ST7735
  • Screen_W32

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×