I really need help to understand how to use libraries in Energia with a msp430 2453 Launchpad.
I'm using version 13 of Energia. I'm really stuck and clueless on how to do this. I've searched and searched for answers but can't figure this out.
I found links to the 5110 LCD driver at https://github.com/energia/Energia/tree/master/examples/7.Display
There are two here...
the LCD_5110 and the LCD_5110_SPI
Which one should I use?
So I click on the link and see these files LCD_5110.cpp and LCD_5100.h.
There's no link to download them.
I can view the contents. But how do you get these into an Energia Sketch ??? Using Right Click Save Target As on these file links only creates an HTML file. I need the .c and .h files - right??
I create my sketches outside of the Energia folder in a desktop folder.
Thanks to all for your help, I really appreciate it.
gerbs11
I found this Sketch and an trying to get it to work
#include <SPI.h>
#include "Energia.h"
#include "SPI.h"
#include "LCD_5110_SPI.h"
LCD_5110_SPI myScreen;
boolean backlight = false;
uint8_t k =0;
void setup(){
SPI.begin();
SPI.setClockDivider(SPI_CLOCK_DIV4);
SPI.setBitOrder(MSBFIRST);
SPI.setDataMode(SPI_MODE0);
myScreen.begin();
myScreen.setBacklight(backlight);
myScreen.text(0,0, "LCD 5110 test");
myScreen.text(0, 5,"Light off");
myScreen.setFont(1);
myScreen.text(0, 2," MSP430");
myScreen.setFont(0);
}
void loop() {
if (myScreen.getButton()) {
backlight = (backlight==0);
myScreen.text(0, 5, backlight ? "Light on " : "Light off");
myScreen.setBacklight(backlight);
}
for (uint8_t i=0; i<14; i++)
myScreen.text(i, 4, (i==k) ? "*" : " ");
k ++;
k %= 14;
delay(200);
}