SLCD lib

Committer:
dogcatfee
Date:
Tue Oct 24 19:00:45 2017 -0700
Revision:
0:87fb32466657
Add files, kl43z compat with clear()

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dogcatfee 0:87fb32466657 1 #include "mbed.h"
dogcatfee 0:87fb32466657 2
dogcatfee 0:87fb32466657 3
dogcatfee 0:87fb32466657 4 /* ------ sample usage------
dogcatfee 0:87fb32466657 5
dogcatfee 0:87fb32466657 6 #include "mbed.h"
dogcatfee 0:87fb32466657 7 #include "SLCD.h"
dogcatfee 0:87fb32466657 8
dogcatfee 0:87fb32466657 9 SLCD slcd;
dogcatfee 0:87fb32466657 10
dogcatfee 0:87fb32466657 11 main()
dogcatfee 0:87fb32466657 12 {
dogcatfee 0:87fb32466657 13 slcd.printf("1234"); // standard printf function, only charaters in ASCII_TO_WF_CODIFICATION_TABLE will display
dogcatfee 0:87fb32466657 14 slcd.putc("A"); // prints a single character
dogcatfee 0:87fb32466657 15 slcd.Write_Char('A'); // prints a single character
dogcatfee 0:87fb32466657 16 slcd.All_Segments(y); // y=1 for ALL segments on, 0 for ALL segments off
dogcatfee 0:87fb32466657 17 slcd.DPx(y); // x=DP1 to DP3, y=1 for on 0 for off
dogcatfee 0:87fb32466657 18 slcd.Colon(y); // y=1 for on, 0 for off
dogcatfee 0:87fb32466657 19 slcd.CharPosition=x; // x=0 to 3, 0 is start position
dogcatfee 0:87fb32466657 20 slcd.Home(); // sets next charater to posistion 0 (start)
dogcatfee 0:87fb32466657 21 slcd.Contrast (x); // set contrast x=0 - 15, 0 lightest, 15 darkest
dogcatfee 0:87fb32466657 22 }
dogcatfee 0:87fb32466657 23 */
dogcatfee 0:87fb32466657 24
dogcatfee 0:87fb32466657 25 class SLCD : public Stream {
dogcatfee 0:87fb32466657 26 public:
dogcatfee 0:87fb32466657 27 SLCD();
dogcatfee 0:87fb32466657 28
dogcatfee 0:87fb32466657 29 void init();
dogcatfee 0:87fb32466657 30 void Write_Char(char lbValue);
dogcatfee 0:87fb32466657 31 void Home (void);
dogcatfee 0:87fb32466657 32 void Contrast (uint8_t lbContrast);
dogcatfee 0:87fb32466657 33 void All_Segments (int);
dogcatfee 0:87fb32466657 34 void clear();
dogcatfee 0:87fb32466657 35 void DP1 (int);
dogcatfee 0:87fb32466657 36 void DP2 (int);
dogcatfee 0:87fb32466657 37 void DP3 (int);
dogcatfee 0:87fb32466657 38 void Colon (int);
dogcatfee 0:87fb32466657 39 uint8_t CharPosition;
dogcatfee 0:87fb32466657 40
dogcatfee 0:87fb32466657 41 virtual int _putc(int c);
dogcatfee 0:87fb32466657 42 virtual int _getc() {
dogcatfee 0:87fb32466657 43 return 0;
dogcatfee 0:87fb32466657 44 }
dogcatfee 0:87fb32466657 45 };