6 x 7 segment display library for PCA9637 driven breakout board

Dependents:   FTSE100 InternetDispBoB digitalThermometer Counter ... more

Committer:
d_worrall
Date:
Wed Jun 29 11:23:47 2011 +0000
Revision:
0:843654413849
Child:
1:d3d2fb119fa3
version1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
d_worrall 0:843654413849 1 //NXP PCA9635 library
d_worrall 0:843654413849 2 //mbed Team - 28th June 2011
d_worrall 0:843654413849 3 //Daniel Worrall
d_worrall 0:843654413849 4
d_worrall 0:843654413849 5 #ifndef MBED_DISPBOB_H
d_worrall 0:843654413849 6 #define MBED_DISPBOB_H
d_worrall 0:843654413849 7
d_worrall 0:843654413849 8 #include "mbed.h"
d_worrall 0:843654413849 9 #include "string"
d_worrall 0:843654413849 10 #include "PCA9635.h"
d_worrall 0:843654413849 11 #include "ctype.h"
d_worrall 0:843654413849 12
d_worrall 0:843654413849 13 class dispBoB {
d_worrall 0:843654413849 14 public:
d_worrall 0:843654413849 15 //constructor
d_worrall 0:843654413849 16 dispBoB(PinName sda, PinName scl, PinName en);
d_worrall 0:843654413849 17
d_worrall 0:843654413849 18 //output control
d_worrall 0:843654413849 19 /** Clear screen
d_worrall 0:843654413849 20 *
d_worrall 0:843654413849 21 */
d_worrall 0:843654413849 22 void cls(void);
d_worrall 0:843654413849 23 /** Set cursor position
d_worrall 0:843654413849 24 *
d_worrall 0:843654413849 25 * @param pos display location left to right (0-5)
d_worrall 0:843654413849 26 */
d_worrall 0:843654413849 27 void locate(char pos);
d_worrall 0:843654413849 28 /** Put an ASCII encoded character onto display at current location
d_worrall 0:843654413849 29 *
d_worrall 0:843654413849 30 * @param c ASCII encoded character or number (no punctuation)
d_worrall 0:843654413849 31 */
d_worrall 0:843654413849 32 void putc(char c);
d_worrall 0:843654413849 33 /** Put an ASCII encoded character onto display at specified location
d_worrall 0:843654413849 34 *
d_worrall 0:843654413849 35 * @param c ASCII encoded character or number
d_worrall 0:843654413849 36 * @param pos display location lef to right (0-5)
d_worrall 0:843654413849 37 */
d_worrall 0:843654413849 38 void putc(char c, char pos);
d_worrall 0:843654413849 39 /** Write a string to the display
d_worrall 0:843654413849 40 *
d_worrall 0:843654413849 41 * @param str String to be displayed
d_worrall 0:843654413849 42 */
d_worrall 0:843654413849 43 void write(string str);
d_worrall 0:843654413849 44 /** Write a scrolling string (right to left) to display (no punctuation)
d_worrall 0:843654413849 45 *
d_worrall 0:843654413849 46 * @param str String to be displayed
d_worrall 0:843654413849 47 * @param speed duration of each frame (seconds)
d_worrall 0:843654413849 48 */
d_worrall 0:843654413849 49 void scroll(string str, float speed);
d_worrall 0:843654413849 50
d_worrall 0:843654413849 51 private:
d_worrall 0:843654413849 52
d_worrall 0:843654413849 53 PCA9635 _pca;
d_worrall 0:843654413849 54 DigitalOut _en;
d_worrall 0:843654413849 55 char _cursor;
d_worrall 0:843654413849 56 };
d_worrall 0:843654413849 57
d_worrall 0:843654413849 58 #endif
d_worrall 0:843654413849 59