6 x 7 segment display library for PCA9637 driven breakout board
Dependents: FTSE100 InternetDispBoB digitalThermometer Counter ... more
Diff: dispBoB.h
- Revision:
- 0:843654413849
- Child:
- 1:d3d2fb119fa3
diff -r 000000000000 -r 843654413849 dispBoB.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dispBoB.h Wed Jun 29 11:23:47 2011 +0000 @@ -0,0 +1,59 @@ +//NXP PCA9635 library +//mbed Team - 28th June 2011 +//Daniel Worrall + +#ifndef MBED_DISPBOB_H +#define MBED_DISPBOB_H + +#include "mbed.h" +#include "string" +#include "PCA9635.h" +#include "ctype.h" + +class dispBoB { +public: + //constructor + dispBoB(PinName sda, PinName scl, PinName en); + + //output control + /** Clear screen + * + */ + void cls(void); + /** Set cursor position + * + * @param pos display location left to right (0-5) + */ + void locate(char pos); + /** Put an ASCII encoded character onto display at current location + * + * @param c ASCII encoded character or number (no punctuation) + */ + void putc(char c); + /** Put an ASCII encoded character onto display at specified location + * + * @param c ASCII encoded character or number + * @param pos display location lef to right (0-5) + */ + void putc(char c, char pos); + /** Write a string to the display + * + * @param str String to be displayed + */ + void write(string str); + /** Write a scrolling string (right to left) to display (no punctuation) + * + * @param str String to be displayed + * @param speed duration of each frame (seconds) + */ + void scroll(string str, float speed); + +private: + + PCA9635 _pca; + DigitalOut _en; + char _cursor; +}; + +#endif +