6 x 7 segment display library for PCA9637 driven breakout board
Dependents: FTSE100 InternetDispBoB digitalThermometer Counter ... more
dispBoB Class Reference
dispBoB class, defined on the I2C master bus More...
#include <dispBoB.h>
Public Member Functions | |
dispBoB (PinName sda, PinName scl, PinName en) | |
Create a dispBoB object defined on the I2C master bus. | |
void | init (void) |
Initialise device. | |
virtual void | cls (void) |
Clear screen. | |
virtual void | locate (char pos) |
Set cursor position. | |
void | scroll (string str, float speed) |
Write a scrolling string (right to left) to display. | |
void | bus (short leds) |
Same functionality as the bus() function on the PCA9635. | |
int | putc (int c) |
Write a character to the display. | |
int | printf (const char *format,...) |
Write a formated string to the LCD. |
Detailed Description
dispBoB class, defined on the I2C master bus
Example:
#include "mbed.h" #include "dispBoB.h" dispBoB db(p28, p27, p26); string str = "This is London calling"; int main() { db.cls(); while(1){ db.scroll(str, 0.25); } }
Definition at line 31 of file dispBoB.h.
Constructor & Destructor Documentation
dispBoB | ( | PinName | sda, |
PinName | scl, | ||
PinName | en | ||
) |
Create a dispBoB object defined on the I2C master bus.
- Parameters:
-
sda I2C data line scl I2C clock line en enable line
Definition at line 37 of file dispBoB.cpp.
Member Function Documentation
void bus | ( | short | leds ) |
Same functionality as the bus() function on the PCA9635.
- Parameters:
-
leds Set output according to parameter value - e.g. 0x0003 >> p0 & p1 high, rest low
Definition at line 126 of file dispBoB.cpp.
void cls | ( | void | ) | [virtual] |
Clear screen.
Definition at line 48 of file dispBoB.cpp.
void init | ( | void | ) |
Initialise device.
Definition at line 40 of file dispBoB.cpp.
void locate | ( | char | pos ) | [virtual] |
Set cursor position.
- Parameters:
-
pos display location left to right (0-5)
Definition at line 57 of file dispBoB.cpp.
int printf | ( | const char * | format, |
... | |||
) |
Write a formated string to the LCD.
- Parameters:
-
format A printf-style format string, followed by the variables to use in formating the string. N.B. it will only display the first 6 characters.
int putc | ( | int | c ) |
Write a character to the display.
- Parameters:
-
c The character to write to the display
void scroll | ( | string | str, |
float | speed | ||
) |
Write a scrolling string (right to left) to display.
- Parameters:
-
str String to be displayed (no punctuation) speed duration of each frame (seconds)
Definition at line 108 of file dispBoB.cpp.
Generated on Wed Jul 13 2022 07:10:58 by 1.7.2