-nil-
Fork of SLCD by
SLCD.h@3:f70873bc6121, 2014-01-27 (annotated)
- Committer:
- star297
- Date:
- Mon Jan 27 21:57:38 2014 +0000
- Revision:
- 3:f70873bc6121
- Parent:
- 1:1579bcd31410
- Child:
- 4:ec7b3c9b2aeb
Confirmed colon/dot functions, tidy code & test. Contrast found not be very effective.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Sissors | 0:d04758e76d5b | 1 | #include "mbed.h" |
Sissors | 0:d04758e76d5b | 2 | |
star297 | 1:1579bcd31410 | 3 | |
star297 | 3:f70873bc6121 | 4 | /* ------ sample usage------ |
star297 | 3:f70873bc6121 | 5 | |
star297 | 3:f70873bc6121 | 6 | #include "mbed.h" |
star297 | 3:f70873bc6121 | 7 | #include "SLCD.h" |
star297 | 3:f70873bc6121 | 8 | |
star297 | 3:f70873bc6121 | 9 | SLCD slcd; |
star297 | 3:f70873bc6121 | 10 | |
star297 | 3:f70873bc6121 | 11 | main() |
star297 | 3:f70873bc6121 | 12 | { |
star297 | 3:f70873bc6121 | 13 | slcd.printf("1234"); // standard printf function, only charaters in ASCII_TO_WF_CODIFICATION_TABLE will display |
star297 | 3:f70873bc6121 | 14 | slcd.putc("A"); // prints a single character |
star297 | 3:f70873bc6121 | 15 | slcd.Write_Char('A'); // prints a single character |
star297 | 3:f70873bc6121 | 16 | slcd.All_Segments(y); // y=1 for ALL segments on, 0 for ALL segments off |
star297 | 3:f70873bc6121 | 17 | slcd.DPx(y); // x=DP1 to DP3, y=1 for on 0 for off |
star297 | 3:f70873bc6121 | 18 | slcd.Colon(y); // y=1 for on, 0 for off |
star297 | 3:f70873bc6121 | 19 | slcd.CharPosition=x; // x=0 to 3, 0 is start position |
star297 | 3:f70873bc6121 | 20 | slcd.Home(); // sets next charater to posistion 0 (start) |
star297 | 3:f70873bc6121 | 21 | slcd.Contrast (x); // set contrast x=0 - 15, 0 lightest, 15 darkest |
star297 | 3:f70873bc6121 | 22 | } |
star297 | 3:f70873bc6121 | 23 | */ |
star297 | 3:f70873bc6121 | 24 | |
Sissors | 0:d04758e76d5b | 25 | class SLCD : public Stream { |
Sissors | 0:d04758e76d5b | 26 | public: |
Sissors | 0:d04758e76d5b | 27 | SLCD(); |
Sissors | 0:d04758e76d5b | 28 | |
Sissors | 0:d04758e76d5b | 29 | void init(); |
star297 | 3:f70873bc6121 | 30 | void Write_Char(char lbValue); |
star297 | 3:f70873bc6121 | 31 | void Home (void); |
star297 | 3:f70873bc6121 | 32 | void Contrast (uint8_t lbContrast); |
star297 | 3:f70873bc6121 | 33 | void All_Segments (int); |
star297 | 3:f70873bc6121 | 34 | void DP1 (int); |
star297 | 3:f70873bc6121 | 35 | void DP2 (int); |
star297 | 3:f70873bc6121 | 36 | void DP3 (int); |
star297 | 3:f70873bc6121 | 37 | void Colon (int); |
star297 | 3:f70873bc6121 | 38 | uint8_t CharPosition; |
star297 | 1:1579bcd31410 | 39 | |
Sissors | 0:d04758e76d5b | 40 | virtual int _putc(int c); |
Sissors | 0:d04758e76d5b | 41 | virtual int _getc() { |
Sissors | 0:d04758e76d5b | 42 | return 0; |
star297 | 1:1579bcd31410 | 43 | } |
Sissors | 0:d04758e76d5b | 44 | }; |