Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of SB1602E by
SB1602E Class Reference
#include <SB1602E.h>
Public Member Functions | |
| SB1602E (PinName I2C_sda, PinName I2C_scl, char *init_massage=NULL) | |
| Create a SB1602E instance which is connected to specified I2C pins with specified address. | |
| SB1602E (I2C &i2c_, char *init_massage=NULL) | |
| Create a PCA9629A instance connected to specified I2C pins with specified address. | |
| ~SB1602E () | |
| Destractor. | |
| void | printf (char line, char *format,...) |
| Printf. | |
| void | printf (char x, char y, char *format,...) |
| Printf. | |
| void | putc (char line, char c) |
| Put character : "putc()". | |
| void | puts (char line, char *s) |
| Put string : "puts()". | |
| void | putcxy (char c, char x, char y) |
| Put character into specified screen position. | |
| void | clear (void) |
| Clear the LCD. | |
| void | contrast (char contrast) |
| Contrast adjustment. | |
| void | put_custom_char (char c_code, const char *cg, char x, char y) |
| Put a custom character given as bitmap data. | |
| void | set_CGRAM (char char_code, const char *cg) |
| Set CGRAM (set custom bitmap as a character) | |
| void | set_CGRAM (char char_code, char v) |
| Set CGRAM (set custom bitmap as a character) | |
| void | puticon (unsigned short flg) |
| Icon operation (for SB1602B) | |
| void | setCharsInLine (char ch) |
| Set number of charactors in a line. | |
Detailed Description
SB1602E class.
This is a driver code for the SB1602E LCD module. This class provides interface for ST7032 operation and accessing its registers.
Example:
#include "mbed.h" #include "SB1602E.h" SB1602E lcd( p9, p10 ); // SDA, SCL int main() { lcd.printf( 0, "Hello world!" ); // line# (0 or 1), string lcd.printf( 1, "pi = %.6f", 3.14159265 ); }
Definition at line 54 of file SB1602E.h.
Constructor & Destructor Documentation
| SB1602E | ( | PinName | I2C_sda, |
| PinName | I2C_scl, | ||
| char * | init_massage = NULL |
||
| ) |
Create a SB1602E instance which is connected to specified I2C pins with specified address.
Text LCD module "SB1602E" class library.
- Parameters:
-
I2C_sda I2C-bus SDA pin I2C_scl I2C-bus SCL pin init_massage string to initialize the LCD
- Version:
- 2.1
- Date:
- 07-April-2015
SB1602E is an I2C based low voltage text LCD panel (based Sitronix ST7032 chip) The module by StrawberryLinux http://strawberry-linux.com/catalog/items?code=27002 (Online shop page (Japanese)) http://strawberry-linux.com/pub/ST7032i.pdf (datasheet of the chip)
This is a library to operate this module easy.
Released under the Apache 2 license License
revision history (class lib name was "TextLCD_SB1602E") revision 1.0 22-Jan-2010 a. 1st release revision 1.1 23-Jan-2010 a. class name has been changed from lcd_SB1602E to TextLCD_SB1602E b. printf() added c. copyright notice added revision 1.3 02-May-2014 a. puticon() added (for SB1602B) by Masato YAMANISHI san revision 2.0 20-Oct-2014 a. class name is changed and published as "SB1602E" b. re-written for better usability revision 2.1 07-Apl-2015 a. add printf() with X and Y position b. add setter for number of chars in a line (e.g. 8x2 LCD support)
Definition at line 33 of file SB1602E.cpp.
| SB1602E | ( | I2C & | i2c_, |
| char * | init_massage = NULL |
||
| ) |
Create a PCA9629A instance connected to specified I2C pins with specified address.
- Parameters:
-
I2C object (instance) init_massage string to initialize the LCD
Definition at line 38 of file SB1602E.cpp.
| ~SB1602E | ( | ) |
Destractor.
Definition at line 43 of file SB1602E.cpp.
Member Function Documentation
| void clear | ( | void | ) |
Clear the LCD.
Definition at line 150 of file SB1602E.cpp.
| void contrast | ( | char | contrast ) |
Contrast adjustment.
- Parameters:
-
contrast value (from 0x00 to 0x3E)
Definition at line 158 of file SB1602E.cpp.
| void printf | ( | char | x, |
| char | y, | ||
| char * | format, | ||
| ... | |||
| ) |
Printf.
printf function with X and Y character position on the LCD. it can be used like
lcd.printf( 0, 0, "Hello world!" ); lcd.printf( 4, 1, "pi = %.6f", 3.14159265 );
- Parameters:
-
x X horizontal character position on the LCD y Y vertical character position on the LCD format following parameters are compatible to stdout's printf
Definition at line 108 of file SB1602E.cpp.
| void printf | ( | char | line, |
| char * | format, | ||
| ... | |||
| ) |
Printf.
printf function with line number. it can be used like
lcd.printf( 0, "Hello world!" ); lcd.printf( 1, "pi = %.6f", 3.14159265 );
- Parameters:
-
line line# (0 for upper, 1 for lower) format following parameters are compatible to stdout's printf
Definition at line 96 of file SB1602E.cpp.
| void put_custom_char | ( | char | c_code, |
| const char * | cg, | ||
| char | x, | ||
| char | y | ||
| ) |
Put a custom character given as bitmap data.
- Parameters:
-
c_code character code cg pointer to bitmap data (array of 8 bytes) x horizontal character position on the LCD y vertical character position on the LCD
Definition at line 166 of file SB1602E.cpp.
| void putc | ( | char | line, |
| char | c | ||
| ) |
Put character : "putc()".
- Parameters:
-
line line# (0 for upper, 1 for lower) c character code
Definition at line 121 of file SB1602E.cpp.
| void putcxy | ( | char | c, |
| char | x, | ||
| char | y | ||
| ) |
Put character into specified screen position.
- Parameters:
-
c character code x horizontal character position on the LCD y vertical character position on the LCD
Definition at line 138 of file SB1602E.cpp.
| void puticon | ( | unsigned short | flg ) |
Icon operation (for SB1602B)
- Parameters:
-
flg bitpattern to choose ICON
Definition at line 243 of file SB1602E.cpp.
| void puts | ( | char | line, |
| char * | s | ||
| ) |
Put string : "puts()".
- Parameters:
-
line line# (0 for upper, 1 for lower) s pointer to a string data
Definition at line 132 of file SB1602E.cpp.
| void set_CGRAM | ( | char | char_code, |
| char | v | ||
| ) |
Set CGRAM (set custom bitmap as a character)
- Parameters:
-
c_code character code v bitmap data (5 bit pattern in this variable are copied to all row of a character bitmap)
Definition at line 182 of file SB1602E.cpp.
| void set_CGRAM | ( | char | char_code, |
| const char * | cg | ||
| ) |
Set CGRAM (set custom bitmap as a character)
- Parameters:
-
c_code character code cg pointer to bitmap data (array of 8 bytes)
Definition at line 174 of file SB1602E.cpp.
Generated on Mon Jul 25 2022 11:11:55 by
1.7.2
