From 1040b4e51ff91467414198f31efc8db6033dc618 Mon Sep 17 00:00:00 2001 From: Mihai Tudor Panu Date: Mon, 5 Oct 2015 17:18:32 -0700 Subject: [PATCH] lcm1602: small patches to comments and examples Signed-off-by: Mihai Tudor Panu --- examples/c++/CMakeLists.txt | 6 ++++-- examples/c++/{lcm1602-lcd.cxx => lcm1602-i2c.cxx} | 4 ++++ .../c++/{lcd-parallel.cxx => lcm1602-parallel.cxx} | 2 +- src/lcd/lcd.h | 2 +- src/lcd/lcm1602.cxx | 1 + src/lcd/lcm1602.h | 13 ++++++++----- 6 files changed, 19 insertions(+), 9 deletions(-) rename examples/c++/{lcm1602-lcd.cxx => lcm1602-i2c.cxx} (96%) rename examples/c++/{lcd-parallel.cxx => lcm1602-parallel.cxx} (98%) diff --git a/examples/c++/CMakeLists.txt b/examples/c++/CMakeLists.txt index 52efe317..b06f470e 100644 --- a/examples/c++/CMakeLists.txt +++ b/examples/c++/CMakeLists.txt @@ -9,7 +9,8 @@ add_executable (grovetemp-example grovetemp.cxx) add_executable (grovebutton-example grovebutton.cxx) add_executable (groverotary-example groverotary.cxx) add_executable (groveslide-example groveslide.cxx) -add_executable (lcm1602-lcd-example lcm1602-lcd.cxx) +add_executable (lcm1602-i2c-example lcm1602-i2c.cxx) +add_executable (lcm1602-parallel-example lcm1602-parallel.cxx) add_executable (jhd1313m1-lcd-example jhd1313m1-lcd.cxx) add_executable (buzzer-sound-example buzzer-sound.cxx) add_executable (my9221-ledbar-example my9221-ledbar.cxx) @@ -266,7 +267,8 @@ target_link_libraries (grovetemp-example grove ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries (grovebutton-example grove ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries (groverotary-example grove ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries (groveslide-example grove ${CMAKE_THREAD_LIBS_INIT}) -target_link_libraries (lcm1602-lcd-example i2clcd ${CMAKE_THREAD_LIBS_INIT}) +target_link_libraries (lcm1602-i2c-example i2clcd ${CMAKE_THREAD_LIBS_INIT}) +target_link_libraries (lcm1602-parallel-example i2clcd ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries (jhd1313m1-lcd-example i2clcd ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries (buzzer-sound-example buzzer ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries (my9221-ledbar-example my9221 ${CMAKE_THREAD_LIBS_INIT}) diff --git a/examples/c++/lcm1602-lcd.cxx b/examples/c++/lcm1602-i2c.cxx similarity index 96% rename from examples/c++/lcm1602-lcd.cxx rename to examples/c++/lcm1602-i2c.cxx index d97fb6bf..f405f96c 100644 --- a/examples/c++/lcm1602-lcd.cxx +++ b/examples/c++/lcm1602-i2c.cxx @@ -32,12 +32,16 @@ main(int argc, char **argv) lcd->setCursor(0,0); lcd->write("Hello World"); //! [Interesting] + sleep(3); lcd->setCursor(1,2); lcd->write("Hello World"); + sleep(3); lcd->setCursor(2,4); lcd->write("Hello World"); + sleep(3); lcd->setCursor(3,6); lcd->write("Hello World"); + sleep(3); delete lcd; return 0; diff --git a/examples/c++/lcd-parallel.cxx b/examples/c++/lcm1602-parallel.cxx similarity index 98% rename from examples/c++/lcd-parallel.cxx rename to examples/c++/lcm1602-parallel.cxx index e79559b7..642c6af3 100644 --- a/examples/c++/lcd-parallel.cxx +++ b/examples/c++/lcm1602-parallel.cxx @@ -23,7 +23,7 @@ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include int main(int argc, char **argv) diff --git a/src/lcd/lcd.h b/src/lcd/lcd.h index 616110b2..5bb9c3ad 100644 --- a/src/lcd/lcd.h +++ b/src/lcd/lcd.h @@ -32,7 +32,7 @@ namespace upm /** * @brief I2C LCD Display library * @defgroup i2clcd libupm-i2clcd - * @ingroup seeed sparkfun adafruit i2c display gsk + * @ingroup seeed sparkfun adafruit i2c gpio display gsk */ class LCD { diff --git a/src/lcd/lcm1602.cxx b/src/lcd/lcm1602.cxx index 68f24990..38f0c878 100644 --- a/src/lcd/lcm1602.cxx +++ b/src/lcd/lcm1602.cxx @@ -8,6 +8,7 @@ * Copyright (c) 2014 Intel Corporation. * * Contributions: Jon Trulson + * Sergey Kiselev * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation diff --git a/src/lcd/lcm1602.h b/src/lcd/lcm1602.h index 0ef992cb..e2fc5124 100644 --- a/src/lcd/lcm1602.h +++ b/src/lcd/lcm1602.h @@ -8,6 +8,7 @@ * Copyright (c) 2014 Intel Corporation. * * Contributions: Jon Trulson + * Sergey Kiselev * * Permission is hereby granted, free of uint8_tge, to any person * obtaining a copy of this software and associated documentation @@ -46,9 +47,9 @@ namespace upm * @sensor lcm1602 * @comname LCM1602 Display * @type display - * @man adafruit sparkfun + * @man adafruit sparkfun seeed * @web https://www.adafruit.com/datasheets/TC1602A-01T.pdf - * @con i2c + * @con i2c gpio * * @brief API for the LCM1602 I2C controller for HD44780-based displays * @@ -56,7 +57,9 @@ namespace upm * controller has no idea of the actual display hardware, so it lets you write * farther than you can see. These displays with such controllers are available * from various manufacturers with different I2C addresses. Adafruit* - * TC1602A-01T seems to be a well-documented example. + * TC1602A-01T seems to be a well-documented example. The driver also supports + * parallel GPIO connections directly to the HD44780 in case you are not using + * an I2C expander/backpack. * * @image html lcm1602.jpeg * @snippet lcm1602-lcd.cxx Interesting @@ -70,13 +73,13 @@ class Lcm1602 : public LCD * @param bus I2C bus to use * @param address Slave address the LCD is registered on * @param isExpander True if we are dealing with an I2C expander, - * false otherwise. Default is true. + * false otherwise. Default is true. */ Lcm1602(int bus, int address, bool isExpander=true, uint8_t numColumns = 16, uint8_t numRows = 4); /** - * Lcm1602 alternate constructor, used for GPIO based hd44780 + * Lcm1602 alternate constructor, used for GPIO based HD44780 * controllers supporting RS, Enable, and 4 data pins in 4-bit * mode. *