PropWare
C++ objects and CMake build system for Parallax Propeller
Home
Download
Getting Started
Documentation
Reference
About
Related Links
Namespace List
Class List
File List
Examples
Build System
File List
File Members
Examples
PropWare_HD44780
HD44780_Demo.cpp
Go to the documentation of this file.
1
26
#include <
PropWare/PropWare.h
>
27
#include <
PropWare/printer/printer.h
>
28
#include <
PropWare/hd44780.h
>
29
30
// Control pins
31
const
PropWare::Port::Mask
RS =
PropWare::Port::P16
;
32
const
PropWare::Port::Mask
RW =
PropWare::Port::P17
;
33
const
PropWare::Port::Mask
EN =
PropWare::Port::P18
;
34
35
// Data pins
36
const
PropWare::Port::Mask
FIRST_DATA_PIN =
PropWare::Port::P19
;
37
const
PropWare::HD44780::Bitmode
BITMODE
=
PropWare::HD44780::BM_8
;
38
const
PropWare::HD44780::Dimensions
DIMENSIONS =
PropWare::HD44780::DIM_16x2
;
39
47
int
main
() {
48
// Create and initialize our LCD object
49
PropWare::HD44780
lcd;
50
lcd.
start
(FIRST_DATA_PIN, RS, RW, EN,
BITMODE
, DIMENSIONS);
51
52
// Create a printer for easy, formatted writing to the LCD
53
PropWare::Printer
lcdPrinter(&lcd);
54
55
// Print to the LCD (exactly 32 characters so that we fill up both lines)
56
lcdPrinter.printf(
"%u %s%d 0x%07X"
, 123456789,
"Hello!"
, -12345, 0xabcdef);
57
58
return
0;
59
}
PropWare::HD44780
Support for the common "character LCD" modules using the HD44780 controller for the Parallax Propelle...
Definition:
hd44780.h:43
PropWare::HD44780::BM_8
Definition:
hd44780.h:50
PropWare::Port::Mask
Mask
Definition:
port.h:40
PropWare::Port::P17
Definition:
port.h:58
PropWare::Printer
Container class that has formatting methods for human-readable output. This class can be constructed ...
Definition:
printer.h:76
BITMODE
const PropWare::SPI::BitMode BITMODE
Definition:
SPI_Demo.cpp:47
PropWare::HD44780::Bitmode
Bitmode
LCD databus width.
Definition:
hd44780.h:48
PropWare::HD44780::Dimensions
Dimensions
Supported LCD dimensions; Used for determining cursor placement.
Definition:
hd44780.h:62
PropWare::Port::P16
Definition:
port.h:57
PropWare::HD44780::DIM_16x2
Definition:
hd44780.h:68
main
int main(void)
Definition:
GraphicsTest.c:20
PropWare.h
PropWare::Port::P18
Definition:
port.h:59
hd44780.h
PropWare::Port::P19
Definition:
port.h:60
printer.h
PropWare::HD44780::start
void start(const PropWare::Pin::Mask lsbDataPin, const Pin rs, const Pin rw, const Pin en, const HD44780::Bitmode bitmode, const HD44780::Dimensions dimensions)
Initialize an HD44780 LCD display.
Definition:
hd44780.h:190
Generated on Sat Aug 27 2016 00:58:03 for PropWare by
1.8.12