Skip to content
Permalink
Browse files

LCD BoosterPack / Nokia 7110 and LCD 5110 Libraries fro LaunchPad and…

… StellarPad
  • Loading branch information
Rei Vilo
Rei Vilo committed Dec 13, 2012
1 parent b642506 commit 95c33da05918ec022c84ffce38d7ce140c50c857
Showing with 706 additions and 501 deletions.
  1. +80 −0 examples/7.Display/LCD_5110/Examples/LCD_5110_main/LCD_5110_main.ino
  2. +11 −10 ...{LCD_5110_430/LCD_5110_430.ino → LCD_5110/Examples/LCD_5110_thermometer/LCD_5110_thermometer.ino}
  3. +21 −7 examples/7.Display/{LCD_5110_430 → LCD_5110}/LCD_5110.cpp
  4. +65 −0 examples/7.Display/LCD_5110/LCD_5110.h
  5. BIN examples/7.Display/LCD_5110/LCD_5110_main - Reference Manual.pdf
  6. +7 −0 examples/7.Display/{LCD_5110_430 → LCD_5110}/ReadMe.txt
  7. +1 −1 examples/7.Display/{LCD_5110_430 → LCD_5110}/Terminal12.h
  8. 0 examples/7.Display/{LCD_5110_430 → LCD_5110}/Terminal6.h
  9. +0 −52 examples/7.Display/LCD_5110_430/LCD_5110.h
  10. +0 −76 examples/7.Display/LCD_5110_430/Thermometer_430.h
  11. +152 −0 examples/7.Display/LCD_BoosterPack/Examples/LCD_7110_thermometer/LCD_7110_thermometer.ino
  12. 0 ...ples/7.Display/{LCD_5110_430 → LCD_BoosterPack/Examples/LCD_7110_thermometer}/Thermometer_430.cpp
  13. +1 −2 ...7.Display/{LCD_BoosterPack_430 → LCD_BoosterPack/Examples/LCD_7110_thermometer}/Thermometer_430.h
  14. +72 −0 examples/7.Display/LCD_BoosterPack/Examples/LCD_BoosterPack_main/LCD_BoosterPack_main.ino
  15. BIN examples/7.Display/LCD_BoosterPack/LCD7110_LM4F - Reference Manual.pdf
  16. +177 −0 examples/7.Display/LCD_BoosterPack/LCD_7110.cpp
  17. +57 −0 examples/7.Display/LCD_BoosterPack/LCD_7110.h
  18. 0 examples/7.Display/{LCD_BoosterPack_430 → LCD_BoosterPack}/ReadMe.txt
  19. +31 −0 examples/7.Display/{LCD_BoosterPack_430 → LCD_BoosterPack}/Terminal12.h
  20. +31 −0 examples/7.Display/{LCD_BoosterPack_430 → LCD_BoosterPack}/Terminal6.h
  21. +0 −141 examples/7.Display/LCD_BoosterPack_430/LCD_5110.cpp
  22. +0 −52 examples/7.Display/LCD_BoosterPack_430/LCD_5110.h
  23. +0 −112 examples/7.Display/LCD_BoosterPack_430/LCD_BoosterPack_430.ino
  24. +0 −48 examples/7.Display/LCD_BoosterPack_430/Thermometer_430.cpp
@@ -0,0 +1,80 @@
//
// LCD_5110_main.ino
// Sketch
// ----------------------------------
// Developed with embedXcode
//
// Project LCD BoosterPack for MSP430G2553 and StallarPad LM4F
// Created by Rei VILO on 28/05/12
// Copyright (c) 2012 http://embeddedcomputing.weebly.com
// Licence CC = BY SA NC
//
// Ported to LM4F120 by Bryan Schremp (bajabug@gmail.com) 11/10/2012
//


// Core library - IDE-based
#if defined(WIRING) // Wiring specific
#include "Wiring.h"
#elif defined(MAPLE_IDE) // Maple specific
#include "WProgram.h"
#elif defined(MPIDE) // chipKIT specific
#include "WProgram.h"
#elif defined(ENERGIA) // LaunchPad, FraunchPad and StellarPad specific
#include "Energia.h"
#elif defined(CORE_TEENSY) // Teensy specific
#include "WProgram.h"
#elif defined(ARDUINO) && (ARDUINO >= 100) // Arduino 1.0 and 1.5 specific
#include "Arduino.h"
#elif defined(ARDUINO) && (ARDUINO < 100) // Arduino 23 specific
#include "WProgram.h"
#else // error
#error Board not supported
#endif

// Include application, user and local libraries
#include "LCD_5110.h"

// Variables
LCD_5110 myScreen;
boolean backlight = false;
uint8_t k = 0;


// Add setup code
void setup() {
myScreen.begin();

myScreen.setBacklight(backlight);
myScreen.text(0, 0, "Hello!");

delay(1000);
// myScreen.clear();
myScreen.text(0, 5, "Light off");
}


// Add loop code
void loop() {
if (myScreen.getButton()) {
backlight = (backlight==0);
myScreen.setFont(0);
myScreen.text(0, 5, backlight ? "Light on " : "Light off");
myScreen.setBacklight(backlight);
}

myScreen.setFont(1);
if (k==0) myScreen.text(0, 2, " MSP430");
else if (k==8) myScreen.text(0, 2, " LM4F ");

myScreen.setFont(0);
for (uint8_t i=0; i<14; i++) myScreen.text(i, 4, (i==k) ? "*" : " ");
k++;
k %= 14;

delay(200);
}




@@ -11,7 +11,7 @@
//

// Core library
#if defined(__MSP430G2452__) || defined(__MSP430G2553__) || defined(__MSP430G2231__) // LaunchPad specific
#if defined(__MSP430G2553__) // LaunchPad MSP430G2553 specific
#include "Energia.h"
#else
#error Board not supported
@@ -51,19 +51,20 @@ boolean backlight = false;

// Add setup code
void setup() {
myThermometer.begin();

myScreen.begin();

myScreen.setFont(1);
myScreen.text(1, 1, "MSP430");
myScreen.setFont(0);
myScreen.text(0, 5, "1234567890abcd");
myScreen.text(0, 0, "Hello");
myScreen.setFont(1);
myScreen.text(1, 2, "MSP430");

delay(1000);
myThermometer.begin();

delay(2000);
myScreen.clear();
myScreen.text(2, 0, "Thermometer");
myScreen.text(0, 5, "off");
myScreen.setFont(0);
myScreen.text(0, 0, "Thermometer");
myScreen.text(0, 5, "Light off");

}

@@ -76,7 +77,7 @@ void loop() {
if (myScreen.getButton()) {
backlight = ~backlight;
myScreen.setFont(0);
myScreen.text(0, 5, backlight ? "on " : "off");
myScreen.text(0, 5, backlight ? "Light on " : "Light off");
myScreen.setBacklight(backlight);
}

@@ -24,15 +24,29 @@ uint8_t _pinSerialClock;
uint8_t _pinPushButton;


#if defined(__MSP430G2553__) // LaunchPad MSP430G2553 specific
LCD_5110::LCD_5110() {
LCD_5110(P2_2, // Chip Select
P2_4, // Serial Clock
P2_0, // Serial Data
P2_3, // Data/Command
P1_0, // Reset
P2_1, // Backlight
PUSH2); // Push Button 2
LCD_5110(P2_2, // Chip Select
P2_4, // Serial Clock
P2_0, // Serial Data
P2_3, // Data/Command
P1_0, // Reset
P2_1, // Backlight
PUSH2); // Push Button 2
}
#elif defined(__LM4F120H5QR__) // StellarPad LM4F specific
LCD_5110::LCD_5110() {
LCD_5110(PA_7, // Chip Select
PA_3, // Serial Clock
PA_5, // Serial Data
PA_2, // Data/Command
PB_5, // Reset
PA_6, // Backlight
PUSH2); // Push Button 2
}
#else
#error Platform not supported
#endif

LCD_5110::LCD_5110(uint8_t pinChipSelect, uint8_t pinSerialClock, uint8_t pinSerialData, uint8_t pinDataCommand, uint8_t pinReset, uint8_t pinBacklight, uint8_t pinPushButton) {
_pinChipSelect = pinChipSelect;
@@ -0,0 +1,65 @@
///
/// @file LCD_5110.h
/// @brief Library for Nokia 5110 display
/// @details Ported to LM4F120 by Bryan Schremp (bajabug@gmail.com) 11/10/2012
/// @n Uses GLCD fonts
/// @n Push button 2 to turn backlight on / off
///
/// @a Developed with [embedXcode](http://embedXcode.weebly.com)
///
/// @author Rei VILO
/// @author http://embeddedcomputing.weebly.com
/// @date Dec 13, 2012
/// @version release 104
/// @n
/// @copyright © Rei VILO, 2010-2012
/// @copyright CC = BY NC SA
/// @n http://embeddedcomputing.weebly.com
///
/// @see
/// * Ported to LM4F120 by Bryan Schremp (bajabug@gmail.com) 11/10/2012
/// @n http://forum.stellarisiti.com/topic/330-lcd-5110-lm4f120-sample-sketch-stellarpad-energia-branch/?p=1333
/// * Fonts generated with MikroElektronika GLCD Font Creator 1.2.0.0
/// @n http://www.mikroe.com
///
// Core library - IDE-based
#if defined(WIRING) // Wiring specific
#include "Wiring.h"
#elif defined(MAPLE_IDE) // Maple specific
#include "WProgram.h"
#elif defined(MPIDE) // chipKIT specific
#include "WProgram.h"
#elif defined(ENERGIA) // LaunchPad, FraunchPad and StellarPad specific
#include "Energia.h"
#elif defined(CORE_TEENSY) // Teensy specific
#include "WProgram.h"
#elif defined(ARDUINO) && (ARDUINO >= 100) // Arduino 1.0 and 1.5 specific
#include "Arduino.h"
#elif defined(ARDUINO) && (ARDUINO < 100) // Arduino 23 specific
#include "WProgram.h"
#else // error
#error Platform not supported
#endif
#ifndef LCD_5110_h
#define LCD_5110_h
#include "Terminal6.h"
#include "Terminal12.h"
class LCD_5110 {
public:
LCD_5110();
LCD_5110(uint8_t pinChipSelect, uint8_t pinSerialClock, uint8_t pinSerialData, uint8_t pinDataCommand, uint8_t pinReset, uint8_t pinBacklight, uint8_t pinPushButton);
void begin();
String WhoAmI();
void clear();
void setBacklight(boolean flag=true);
void setFont(uint8_t font=0);
uint8_t fontX();
uint8_t fontY();
void text(uint8_t x, uint8_t y, String s);
boolean getButton();
private:
void setXY(uint8_t x, uint8_t y);
void write(uint8_t dataCommand, uint8_t c);
uint8_t _font;
};
#endif
Binary file not shown.
@@ -32,3 +32,10 @@
CC = BY NC SA
http:embedXcode.weebly.com/

Developed with embedXcode
----------------------------------
Embedded Computing Template on Xcode 4.3
© Rei VILO, 2010-2012
CC = BY NC SA
http:embedXcode.weebly.com/

@@ -1,5 +1,5 @@
//
// Terminal11.h
// Terminal12.h
// Font library
// ----------------------------------
// Developed with embedXcode
File renamed without changes.

This file was deleted.

This file was deleted.

0 comments on commit 95c33da

Please sign in to comment.
You can’t perform that action at this time.