SLCD lib

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SLCD.h Source File

SLCD.h

00001 #include "mbed.h"
00002 
00003 
00004 /*  ------ sample usage------
00005 
00006     #include "mbed.h"
00007     #include "SLCD.h"
00008     
00009     SLCD slcd;
00010     
00011     main()
00012     {
00013         slcd.printf("1234");    // standard printf function, only charaters in ASCII_TO_WF_CODIFICATION_TABLE will display
00014         slcd.putc("A");         // prints a single character 
00015         slcd.Write_Char('A');   // prints a single character
00016         slcd.All_Segments(y);   // y=1 for ALL segments on, 0 for ALL segments off  
00017         slcd.DPx(y);            // x=DP1 to DP3, y=1 for on 0 for off
00018         slcd.Colon(y);          // y=1 for on, 0 for off
00019         slcd.CharPosition=x;    // x=0 to 3, 0 is start position
00020         slcd.Home();            // sets next charater to posistion 0 (start)
00021         slcd.Contrast (x);      // set contrast x=0 - 15, 0 lightest, 15 darkest    
00022     }   
00023 */
00024 
00025 class SLCD : public Stream {
00026     public:
00027     SLCD();
00028     
00029     void init();
00030     void Write_Char(char lbValue);
00031     void Home (void);
00032     void Contrast (uint8_t lbContrast);
00033     void All_Segments (int);     
00034     void clear();
00035     void DP1 (int);
00036     void DP2 (int);
00037     void DP3 (int);
00038     void Colon (int);     
00039     uint8_t CharPosition;
00040 
00041     virtual int _putc(int c);
00042     virtual int _getc() {
00043       return 0;
00044     }  
00045 };