Jump to content
johnrdorazio

[Energia Library] LiquidCrystal library for CC3200 Launchpad

Recommended Posts

Now that CC3200 support has been added to Energia in the past few releases, I am wondering if the core libraries will be made available for the CC3200. Specifically I am trying to use a 16x2 LCD, but I see that the LiquidCrystal library is not available for the CC3200. May I ask for CC3200 support for the LiquidCrystal library?

Share this post


Link to post
Share on other sites

Hello @@johnrdorazio

 

I was curious about this after reading your post. I hooked up my CC3200 and after some investigation got the LiquidCrystal library to work by doing the following:

 

1) go to the File tab and use Open... Then navigate to energia-0101E0015/hardware/msp430/libraries/LiquidCrystal/examples/HelloWorld. You may have a different Energia version so adjust accordingly.

2) go to Sketch tab and use Add File... to add LiquidCrystal.cpp and LiquidCrystal.h which are in the LiquidCrystal folder in step 1) above.

3) change the line #include <LiquidCrystal> to #include "LiquidCrystal"

4) specify your pins by number instead of port. For example I am using the following in the instantiation:

LiquidCrystal lcd(5, 6, 7, 8, 9, 10). You must hook up the LCD pins to match of course.

 

What is happening here is that libraries for some LauncPads are in different places. A cc3200 library for LiquidCrystal is not present but the MSP430 library seems to work if you change the pins. Note that using ports, e.g. using P4_1 instead of 10, in the instantiation does not seem to work. This seems to be the case for some of the other LaunchPads as well.

 

Hope this helps...

Share this post


Link to post
Share on other sites

Hello @@johnrdorazio

 

1) go to the File tab and use Open... Then navigate to energia-0101E0015/hardware/msp430/libraries/LiquidCrystal/examples/HelloWorld. You may have a different Energia version so adjust accordingly.

2) go to Sketch tab and use Add File... to add LiquidCrystal.cpp and LiquidCrystal.h which are in the LiquidCrystal folder in step 1) above.

3) change the line #include <LiquidCrystal> to #include "LiquidCrystal"

 

I should add that you won't need to do all this if you put a copy of this in your library.

Share this post


Link to post
Share on other sites

In fact in the end we just copied the library over from the MSP430 folder and pasted it into the CC3200 folder, and it works just fine. I'm using it like this:

#include <LiquidCrystal.h>

//DEFINE LIQUID CRYSTAL PINS

#define LQCR_RS 2
#define LQCR_EN 3
#define LQCR_D0 4
#define LQCR_D1 5
#define LQCR_D2 6
#define LQCR_D3 7
#define LQCR_D4 8
#define LQCR_D5 9
#define LQCR_D6 10
#define LQCR_D7 30

//INITIALIZE LIQUID CRYSTAL DISPLAY

LiquidCrystal lcd(LQCR_RS, LQCR_EN, LQCR_D0, LQCR_D1, LQCR_D2, LQCR_D3, LQCR_D4, LQCR_D5, LQCR_D6, LQCR_D7);

void setup(){
  //SETUP LCD columns and rows: 
  lcd.begin(16, 2);

  lcd.clear();
  delay(20);
  lcd.print("***** READY ****");
  delay(100);

  lcd.setCursor(0,1);
  lcd.print("Set...");
  delay(100);

  lcd.setCursor(9,1);
  lcd.print("GO !!!");
}
 
This is using all 8 digital pins, if you want to write custom characters into the 8 custom character slots.
If this is not needed, then 4 digital pins are enough for printing to the display.
 

 

Share this post


Link to post
Share on other sites

@@johnrdorazio - I'm glad this worked for you.  I don't think you need to use all 8 digital pins to display custom characters.  You can do that using D4-D7 only.  When you do, it just sends two 4 bit messages to the display controller in place of an 8 bit message.  I don't think I've ever hooked up all eight.

Share this post


Link to post
Share on other sites

I saw that all 8 digital pins are not needed to display the characters, but they seem to be needed to write the characters into memory in the first place (using the "lcd.createChar()" function), or at least using only 4 digital pins was not working for me when trying to "lcd.createChar", but it worked fine when using all 8... Maybe it's not needed to create the characters either (in fact the example for Arduino only uses 4 digital pins), but for some reason that seems to be the only way it worked for me.

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

×