Jump to content
43oh

[Energia Library] LCD_screen Library Suite


Recommended Posts

The library for the Kentec 3.5" is close to completion. 

 

Thanks to its 8-bit parallel connection, writing to and reading from the screen are much faster!

 

49 ms only to copy-paste a 64x64 area instead of the 438 ms required by the SPI-connected HY28A.

 

post-389-14264605292958_thumb.jpg

 

I have still to finalise the touch interface and obviously the documentation...

 

Having the SRAM + EEPROM BoosterPack would be nice.

 

:)

Link to post
Share on other sites
  • Replies 94
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

As of October 2015 and due to intellectual property issues and licence infringements with users, the LCD_screen Library Suite is no longer available for download.   A special edition of the library is

Good news! The LCD_GUI library is available and brings the usual elements of a graphic interface as: label, button, dialog box, menu, slider and text box.     The project is based on a LaunchP

Give me some time to get some rest!   IMHO, implementing SD-card instead of SRAM shouldn't be difficult. You need to change 2 functions: void LCD_HY28A_SRAM::_fastCopyAreaToSRAM(uint16_t x0, uint1

Posted Images

I'm experiencing unexpected difficulties with reading the coordinates from the 4-wire resistive touch-screen of the Kentec 3.5".

 

When moving my finger horizontally, both x and y coordinates change. Same for vertically.

 

Only one coordinate should change. I suspect some initialisation problem.

 

See the specific thread HELP - 4-Wire Resistive Touch-Screen Reading with Energia.

 

Thank you for your help!

Link to post
Share on other sites

I have a ino file for old HY28A lib

this is 10x6 squares drawn in loop and tables of chars drawn in the same loop too...

 

I don't know if it will be useful for you:

//KEYBOARD
#define KBDROWS       5     //number of keyboard rows
#define KBDCOLS       10    //number of keyboard cols
#define KBDSTEP       32    //distance (in px) between the start of two buttons
#define KBDLEFT       2     //absolute distance from the left side of the display 
#define KBDTOP        48    //absolute distance from the top of the display
#define KBDFONTLEFT   4     //absolute distance from the left side of the display to the first letter (eq. 1,q,a,z,<)
#define KBDBTNSIZE    28    //button size (without frame)
#define KBDFONTSIZE   3     //keyboard font size
#define KBDFNCBTNSIZE 60    //function keys h size

#define  KEY_SPACE    0x20
#define  KEY_CLEAR    0x7f
#define  KEY_ENTER    0x0a
#define  KEY_EXIT     0xfe
#define  KEY_SHIFT    0xfd
#define  KEY_NULL     0xff 

const char  keyboard[51]= "1234567890qwertyuiopasdfghjkl:zxcvbnm,.?<>-+*/=[]'";
const char  keyboardshift[51]= "!@#$%^&_()QWERTYUIOPASDFGHJKL:ZXCVBNM<>?{}[]-+\";\\|";

void printquerty()
{
   uint8_t x,y;
   char onefont[2];
   for(y = 0; y < KBDROWS; y++)
   {
     for(x = 0; x < KBDCOLS; x++)
     {
       myScreen.dRectangle((KBDLEFT+(KBDSTEP*x)), (KBDTOP+(KBDSTEP*y)), KBDBTNSIZE, KBDBTNSIZE, grayColour);
       if ( SHIFT ) { onefont[0]=keyboardshift[((y*10)+x)]; } else { onefont[0]=keyboard[((y*10)+x)]; }
       myScreen.gText((KBDLEFT+KBDFONTLEFT+(KBDSTEP*x)), (KBDTOP+KBDFONTLEFT+(KBDSTEP*y)), (String)onefont[0], whiteColour, grayColour, KBDFONTSIZE, KBDFONTSIZE);
     }
   }
}

void printfunckeys()
{
    uint16_t funckeycolor;
    
    myScreen.dRectangle(KBDLEFT, (KBDTOP+(KBDSTEP*5)), KBDFNCBTNSIZE, KBDBTNSIZE, grayColour);
    myScreen.gText((KBDLEFT+(KBDFONTLEFT*4)), (KBDTOP+KBDFONTLEFT+(KBDSTEP*5)), "exit", whiteColour, grayColour, KBDFONTSIZE-2, KBDFONTSIZE);
    
    myScreen.dRectangle(KBDLEFT+(KBDSTEP*2), (KBDTOP+(KBDSTEP*5)), KBDFNCBTNSIZE, KBDBTNSIZE, grayColour);
    myScreen.gText(KBDLEFT+(KBDFONTLEFT*4)+(KBDSTEP*2), (KBDTOP+KBDFONTLEFT+(KBDSTEP*5)), "clear", whiteColour, grayColour, KBDFONTSIZE-2, KBDFONTSIZE);
    
    myScreen.dRectangle(KBDLEFT+(KBDSTEP*4), (KBDTOP+(KBDSTEP*5)), KBDFNCBTNSIZE, KBDBTNSIZE, grayColour);
    myScreen.gText(KBDLEFT+(KBDFONTLEFT*4)+(KBDSTEP*4), (KBDTOP+KBDFONTLEFT+(KBDSTEP*5)), "space", whiteColour, grayColour, KBDFONTSIZE-2, KBDFONTSIZE);
    
    myScreen.dRectangle(KBDLEFT+(KBDSTEP*6), (KBDTOP+(KBDSTEP*5)), KBDFNCBTNSIZE, KBDBTNSIZE, grayColour);
    if ( SHIFT ) { funckeycolor=blueColour; } else { funckeycolor=whiteColour; }   
    myScreen.gText(KBDLEFT+(KBDFONTLEFT*4)+(KBDSTEP*6), (KBDTOP+KBDFONTLEFT+(KBDSTEP*5)), "shift", funckeycolor, grayColour, KBDFONTSIZE-2, KBDFONTSIZE);
    
    myScreen.dRectangle(KBDLEFT+(KBDSTEP*8), (KBDTOP+(KBDSTEP*5)), KBDFNCBTNSIZE, KBDBTNSIZE, grayColour);
    myScreen.gText(KBDLEFT+(KBDFONTLEFT*4)+(KBDSTEP*8), (KBDTOP+KBDFONTLEFT+(KBDSTEP*5)), "enter", whiteColour, grayColour, KBDFONTSIZE-2, KBDFONTSIZE);    
}

void getkey()
{
  int xres, yres;
 
  xres=(int)(x-KBDLEFT)/KBDSTEP;  //x from myScreen.getTouch(x, y, z)
  yres=(int)(y-KBDTOP)/KBDSTEP;   //y from myScreen.getTouch(x, y, z)

  if ((xres<KBDCOLS) && (yres<KBDROWS))
  {
    if ( SHIFT ) { pressedkey[0]=keyboardshift[((yres*10)+xres)]; } else { pressedkey[0]=keyboard[((yres*10)+xres)]; } 
  }
  else if (yres==5)
  {
    switch(x) 
    {
      case KBDLEFT ... (KBDLEFT+KBDFNCBTNSIZE):
          pressedkey[0]=KEY_EXIT;
          break;
      case (KBDLEFT+(KBDSTEP*2)) ... (KBDLEFT+(KBDSTEP*2)+KBDFNCBTNSIZE):
          pressedkey[0]=KEY_CLEAR;
          break;
      case (KBDLEFT+(KBDSTEP*4)) ... (KBDLEFT+(KBDSTEP*4)+KBDFNCBTNSIZE):
          pressedkey[0]=KEY_SPACE;
          break; 
      case (KBDLEFT+(KBDSTEP*6)) ... (KBDLEFT+(KBDSTEP*6)+KBDFNCBTNSIZE):
          pressedkey[0]=KEY_SHIFT;
          break; 
      case (KBDLEFT+(KBDSTEP*8)) ... (KBDLEFT+(KBDSTEP*8)+KBDFNCBTNSIZE):
          pressedkey[0]=KEY_ENTER;
          break;              
    }      
  }
  else
    pressedkey[0]=KEY_NULL;   
}
Link to post
Share on other sites

Nice :)

 

Many questions:

 

How to deal with the letters with accents. Most of the European language include many of them.

 

For example, to name a few:

  • In French: àâäæéèêëîïôöœùüû瀜
  • In Spanish: áäéëíïóöúüñ¿¡

Why not using a smartphone-like keyboard?

 

Some popular smartphone feature four pages, each page with 4 lines and up to 10 keys per line. It saves a lot of space.

 

How to deal with Backspace?

Link to post
Share on other sites

This is only old example / concept, who used my old Terminal6x8 chars(all) without regional :(

 

Backspace realized by "clear" button on bottom line(KEY_CLEAR), in my case simply move cursor back (1 letter width),  not included in example above.

 

Smartphone-like keyboard? I use http://www.etaoikeyboard.com :D -> one line with 5 multi-keys ;)

 

BTW - I never thought about it, I just played with this a hour or two ;)

I think that You choose something suitable for most users

 

P.S. in Polish: ąĄćĆęĘłŁńŃóÓśŚźŹżŻ

Link to post
Share on other sites

New issue:


    /// @bug    trim() doesn't work on Stellaris

    /// @see    http://github.com/energia/Energia/issues/257

 

Now fixed with a manual function: 

    uint8_t i = 0;
    uint8_t j = _text.length();
    while ((_text.charAt(i)==' ') && (i<j)) {
        i++;
    }
    while ((_text.charAt(j)==' ') && (j>0)) {
        j--;
    }
    if (j>i) _text = _text.substring(i, j);
    else _text = "";
Link to post
Share on other sites
  • 2 weeks later...

@@abecedarian, yes :)

 

Ideally a in-between BoosterPack with room for

  • 2x 1Mb fast SRAM for caching 
  • enough EEPROM for fonts
  • SD-card or uSD-card slot

All this on one single hardware SPI bus with 3 CS, and ideally with jumpers to select the SPI bus among the 4 of the Launchpad Stellaris...

 

Well, back to the 8-bit parallel Kentec 3.5" screen...

 

I posted a Call for Design - SD-Card + EEPROM + SRAM BoosterPack for Stellaris LaunchPad and also at the sister 43oh website.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...