Jump to content
43oh

[Energia Library] The $4.30 LCD BoosterPack / Nokia 7110 LCD


Recommended Posts

  • 4 weeks later...
  • 3 years later...

I made an extension for the LCD library to support 4x6 font, like ye olde TI graphing calculators.

 

In LCD_SharpBoosterPack_SPI.h, after

#include "Terminal12.h"

add

#include "Terminal4.h"

 

In LCD_SharpBoosterPack_SPI.cpp, in LCD_SharpBoosterPack_SPI::text after

    else if (_font==1) {
        for (j=0; j<s.length(); j++) {
            for (i=0; i<11; i++){
                for (k=7; k>=0; k--){ 
                    setXY(x+offset, y+k,   Terminal11x16[s.charAt(j)-' '][2*i]&(1<<k));
                    setXY(x+offset, y+k+8, Terminal11x16[s.charAt(j)-' '][2*i+1]&(1<<k));
                }
                offset += 1;
            }
            offset += 1;  // spacing
        }
    }

add

    else if (_font==2) {
        for (j=0; j<s.length(); j++) {
            for (i=0; i<3; i++){ 
                for (k=4; k>=0; k--) setXY(x+offset, y+k, Terminal4x6[s.charAt(j)-' ']&(1<<(14 - i - k*3)));
                offset += 1;
            }
            offset += 1;  // spacing
        }
    }

Add the attached header (Terminal4.h) to your library directory.

 

Note: I did not test this, because I do not own an LCD boosterpack. I might accidentally have flipped the font one way or the other, hope I didn't : )

Terminal4.h

Terminal4.txt

Terminal4.py.txt

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...