Generic communication interface between the wireless board (mote) and the sensor board. Any kind of sensor board can be connected to the mote using this specification given it provides a SPI peripheral, one input pin with interrupt capability and one digital output. The sensor board must implement a special register set from which all required information can be retrieved. Protocol: http://is.gd/wuQorh Github: http://is.gd/ySj1L9
Diff: SLCD/SLCD.h
- Revision:
- 1:acdf490d94a7
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SLCD/SLCD.h Tue Apr 08 16:34:20 2014 +0000 @@ -0,0 +1,44 @@ +#include "mbed.h" + + +/* ------ sample usage------ + + #include "mbed.h" + #include "SLCD.h" + + SLCD slcd; + + main() + { + slcd.printf("1234"); // standard printf function, only charaters in ASCII_TO_WF_CODIFICATION_TABLE will display + slcd.putc("A"); // prints a single character + slcd.Write_Char('A'); // prints a single character + slcd.All_Segments(y); // y=1 for ALL segments on, 0 for ALL segments off + slcd.DPx(y); // x=DP1 to DP3, y=1 for on 0 for off + slcd.Colon(y); // y=1 for on, 0 for off + slcd.CharPosition=x; // x=0 to 3, 0 is start position + slcd.Home(); // sets next charater to posistion 0 (start) + slcd.Contrast (x); // set contrast x=0 - 15, 0 lightest, 15 darkest + } +*/ + +class SLCD : public Stream { + public: + SLCD(); + + void init(); + void Write_Char(char lbValue); + void Home (void); + void Contrast (uint8_t lbContrast); + void All_Segments (int); + void DP1 (int); + void DP2 (int); + void DP3 (int); + void Colon (int); + uint8_t CharPosition; + + virtual int _putc(int c); + virtual int _getc() { + return 0; + } +};