1
0
mirror of https://github.com/taigrr/arduinolibs synced 2025-01-18 04:33:12 -08:00

Rename FreetronicsLCD to just LCD

This commit is contained in:
Rhys Weatherley
2012-05-25 09:27:26 +10:00
parent 9a674fc632
commit fa9284a5a3
36 changed files with 76 additions and 76 deletions

View File

@@ -78,7 +78,7 @@ Field::~Field()
/**
* \brief Dispatches \a event via this field.
*
* The \a event is usually obtained from FreetronicsLCD::getButton().
* The \a event is usually obtained from LCD::getButton().
*
* Returns zero if the \a event has been handled and no further action
* is required.
@@ -91,7 +91,7 @@ Field::~Field()
* be handled by the Form itself (particularly for Left and Right buttons).
* The default implementation returns -1 for all events.
*
* \sa Form::dispatch(), FreetronicsLCD::getButton()
* \sa Form::dispatch(), LCD::getButton()
*/
int Field::dispatch(int event)
{

View File

@@ -72,7 +72,7 @@ Form::~Form()
* \brief Dispatches \a event to the currently active field using
* Field::dispatch().
*
* The \a event is usually obtained from FreetronicsLCD::getButton().
* The \a event is usually obtained from LCD::getButton().
*
* Returns zero if the \a event has been handled and no further action
* is required.
@@ -94,7 +94,7 @@ Form::~Form()
*
* This function handles the Left and Right buttons to navigate between fields.
*
* \sa Field::dispatch(), FreetronicsLCD::getButton(), currentField(), isCurrent()
* \sa Field::dispatch(), LCD::getButton(), currentField(), isCurrent()
*/
int Form::dispatch(int event)
{

View File

@@ -23,7 +23,7 @@
#ifndef Form_h
#define Form_h
#include "FreetronicsLCD.h"
#include "LCD.h"
class Field;

View File

@@ -20,7 +20,7 @@
* DEALINGS IN THE SOFTWARE.
*/
#include "FreetronicsLCD.h"
#include "LCD.h"
#include <avr/pgmspace.h>
#include <WProgram.h>
@@ -30,7 +30,7 @@
#define DEBOUNCE_DELAY 10 // Delay in ms to debounce buttons
/**
* \class FreetronicsLCD FreetronicsLCD.h <FreetronicsLCD.h>
* \class LCD LCD.h <LCD.h>
* \brief Enhanced library for Freetronics 16x2 LCD shields
*
* This class extends the standard Arduino LiquidCrystal library with
@@ -70,13 +70,13 @@
* generic button has been released with <tt>button &lt; 0</tt>.
*
* See the \ref lcd_hello_world "Hello World" example for more
* information on using the FreetronicsLCD class.
* information on using the LCD class.
*
* \sa Form
*/
/**
* \fn FreetronicsLCD::FreetronicsLCD()
* \fn LCD::LCD()
* \brief Initialize the Freetronics LCD display with the default
* pin assignment.
*
@@ -84,12 +84,12 @@
* LCD shield:
*
* \code
* FreetronicsLCD lcd;
* LCD lcd;
* \endcode
*/
/**
* \fn FreetronicsLCD::FreetronicsLCD(uint8_t pin9)
* \fn LCD::LCD(uint8_t pin9)
* \brief Initialize the Freetronics LCD display for USBDroid.
*
* On the USBDroid, the D9 pin is used for USB Host functionality.
@@ -104,11 +104,11 @@
* Web page of A1, you would initialize the LCD as follows:
*
* \code
* FreetronicsLCD lcd(A1);
* LCD lcd(A1);
* \endcode
*/
void FreetronicsLCD::init()
void LCD::init()
{
// The Freetronics display is 16x2.
begin(16, 2);
@@ -141,7 +141,7 @@ void FreetronicsLCD::init()
*
* \sa noDisplay(), enableScreenSaver(), setScreenSaverMode()
*/
void FreetronicsLCD::display()
void LCD::display()
{
LiquidCrystal::display();
digitalWrite(LCD_BACK_LIGHT, HIGH);
@@ -156,7 +156,7 @@ void FreetronicsLCD::display()
*
* \sa display(), enableScreenSaver(), setScreenSaverMode()
*/
void FreetronicsLCD::noDisplay()
void LCD::noDisplay()
{
if (mode == DisplayOff)
LiquidCrystal::noDisplay();
@@ -165,30 +165,30 @@ void FreetronicsLCD::noDisplay()
}
/**
* \enum FreetronicsLCD::ScreenSaverMode
* \enum LCD::ScreenSaverMode
* \brief Screen saver mode that controls the display and back light.
*/
/**
* \var FreetronicsLCD::DisplayOff
* \var LCD::DisplayOff
* \brief Turn off both the display and the backlight when the screen saver
* is activated.
*/
/**
* \var FreetronicsLCD::BacklightOff
* \var LCD::BacklightOff
* \brief Turn off the back light but leave the display on when the screen
* saver is activated.
*/
/**
* \var FreetronicsLCD::BacklightOnSelect
* \var LCD::BacklightOnSelect
* \brief Same as BacklightOff but the screen saver is only deactivated when
* Select is pressed; other buttons have no effect.
*/
/**
* \fn ScreenSaverMode FreetronicsLCD::screenSaverMode() const
* \fn ScreenSaverMode LCD::screenSaverMode() const
* \brief Returns the current screen saver mode; default is DisplayOff.
*
* \sa setScreenSaverMode(), enableScreenSaver()
@@ -199,7 +199,7 @@ void FreetronicsLCD::noDisplay()
*
* \sa screenSaverMode(), enableScreenSaver()
*/
void FreetronicsLCD::setScreenSaverMode(ScreenSaverMode mode)
void LCD::setScreenSaverMode(ScreenSaverMode mode)
{
if (this->mode != mode) {
this->mode = mode;
@@ -225,7 +225,7 @@ void FreetronicsLCD::setScreenSaverMode(ScreenSaverMode mode)
*
* \sa disableScreenSaver(), display(), getButton(), isScreenSaved()
*/
void FreetronicsLCD::enableScreenSaver(int timeoutSecs)
void LCD::enableScreenSaver(int timeoutSecs)
{
if (timeoutSecs < 0)
timeout = 0;
@@ -239,14 +239,14 @@ void FreetronicsLCD::enableScreenSaver(int timeoutSecs)
*
* \sa enableScreenSaver(), display(), isScreenSaved()
*/
void FreetronicsLCD::disableScreenSaver()
void LCD::disableScreenSaver()
{
timeout = 0;
display();
}
/**
* \fn bool FreetronicsLCD::isScreenSaved() const
* \fn bool LCD::isScreenSaved() const
* \brief Returns true if the screen has been saved; false otherwise.
*
* \sa enableScreenSaver()
@@ -284,7 +284,7 @@ static prog_uint8_t const buttonMappings[] PROGMEM = {
*
* \sa enableScreenSaver(), display(), Form::dispatch()
*/
int FreetronicsLCD::getButton()
int LCD::getButton()
{
// Read the currently pressed button.
int button = mapButton(analogRead(LCD_BUTTON_PIN));

View File

@@ -20,8 +20,8 @@
* DEALINGS IN THE SOFTWARE.
*/
#ifndef FreetronicsLCD_h
#define FreetronicsLCD_h
#ifndef LCD_h
#define LCD_h
// Extended version of the LiquidCrystal library that works specifically
// with Freetronics' 16x2 LCD display, including support for the back
@@ -45,10 +45,10 @@
#define LCD_BUTTON_DOWN_RELEASED -4
#define LCD_BUTTON_SELECT_RELEASED -5
class FreetronicsLCD : public LiquidCrystal {
class LCD : public LiquidCrystal {
public:
FreetronicsLCD() : LiquidCrystal(8, 9, 4, 5, 6, 7) { init(); }
FreetronicsLCD(uint8_t pin9) : LiquidCrystal(8, pin9, 4, 5, 6, 7) { init(); }
LCD() : LiquidCrystal(8, 9, 4, 5, 6, 7) { init(); }
LCD(uint8_t pin9) : LiquidCrystal(8, pin9, 4, 5, 6, 7) { init(); }
void display();
void noDisplay();

View File

@@ -1,12 +1,12 @@
/*
This example demonstrates how to use the Form and Field classes from the
FreetronicsLCD library to provide a simple UI on the 16x2 LCD display.
LCD library to provide a simple UI on the 16x2 LCD display.
This example is placed into the public domain.
*/
// include the library code:
#include <FreetronicsLCD.h>
#include <LCD.h>
#include <Form.h>
#include <TextField.h>
#include <TimeField.h>
@@ -14,11 +14,11 @@ This example is placed into the public domain.
#include <BoolField.h>
// Initialize the LCD
FreetronicsLCD lcd;
LCD lcd;
// Note: if you are using the USBDroid and have reassigned pin D9 on the LCD shield to some
// other pin (e.g. A1), then you will need to initialize the shield with something like:
// FreetronicsLCD lcd(A1);
// LCD lcd(A1);
// See also: http://www.freetronics.com/pages/combining-the-lcd-keypad-shield-and-the-usbdroid
// Create the main form and its fields.

View File

Before

Width:  |  Height:  |  Size: 502 KiB

After

Width:  |  Height:  |  Size: 502 KiB

View File

Before

Width:  |  Height:  |  Size: 400 KiB

After

Width:  |  Height:  |  Size: 400 KiB

View File

Before

Width:  |  Height:  |  Size: 475 KiB

After

Width:  |  Height:  |  Size: 475 KiB

View File

Before

Width:  |  Height:  |  Size: 485 KiB

After

Width:  |  Height:  |  Size: 485 KiB

View File

Before

Width:  |  Height:  |  Size: 453 KiB

After

Width:  |  Height:  |  Size: 453 KiB

View File

@@ -1,5 +1,5 @@
/*
This example demonstrates how to use the FreetronicsLCD library, which extends the
This example demonstrates how to use the LCD library, which extends the
standard LiquidCrystal library to provide support for the Freetronics back light
and Up/Down/Left/Right/Select buttons. More information on the shield here:
@@ -8,12 +8,12 @@ http://www.freetronics.com/pages/16x2-lcd-shield-quickstart-guide
This example is placed into the public domain.
*/
#include <FreetronicsLCD.h>
FreetronicsLCD lcd;
#include <LCD.h>
LCD lcd;
// Note: if you are using the USBDroid and have reassigned pin D9 on the LCD shield to some
// other pin (e.g. A1), then you will need to initialize the shield with something like:
// FreetronicsLCD lcd(A1);
// LCD lcd(A1);
// See also: http://www.freetronics.com/pages/combining-the-lcd-keypad-shield-and-the-usbdroid
void setup() {

View File

Before

Width:  |  Height:  |  Size: 518 KiB

After

Width:  |  Height:  |  Size: 518 KiB

View File

@@ -1,4 +1,4 @@
FreetronicsLCD KEYWORD1
LCD KEYWORD1
Form KEYWORD1
Field KEYWORD1
BoolField KEYWORD1

View File

@@ -21,7 +21,7 @@
*/
// include the library code:
#include <FreetronicsLCD.h>
#include <LCD.h>
#include <Form.h>
#include <Field.h>
#include <BoolField.h>
@@ -55,7 +55,7 @@
#define SETTING_MELODY 3 // Melody to play for the alarm
// Initialize the LCD
FreetronicsLCD lcd;
LCD lcd;
// Activate the realtime clock chip.
SoftI2C bus(RTC_DATA, RTC_CLOCK);
@@ -104,7 +104,7 @@ void setup() {
power_timer1_disable();
// Enable the screen saver.
lcd.setScreenSaverMode(FreetronicsLCD::BacklightOnSelect);
lcd.setScreenSaverMode(LCD::BacklightOnSelect);
lcd.enableScreenSaver(3);
// Initialize the alarm melody.