A basic library for the Freetronics arduino LCD shield.
Fork of freetronicsLCDShield by
Diff: freetronicsLCDShield.h
- Revision:
- 0:01f3d38f8b6d
- Child:
- 1:ddcefddda4a7
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/freetronicsLCDShield.h Tue Oct 08 08:46:39 2013 +0000 @@ -0,0 +1,43 @@ +#define LEFT 0 +#define RIGHT 1 + +class freetronicsLCDShield : public Stream { + private: + // Functions + void writeByte (int byte); + void writeCommand (int command); + void writeData (int data); + void character(int line, int col, int value); + + // Hardware + DigitalOut _rs, _e; + BusOut _d; + PwmOut _bl; + AnalogIn _a0; + + public: + // Constructor + freetronicsLCDShield (PinName rs = PTA13, + PinName e = PTD5, + PinName d0 = PTA4, + PinName d1 = PTA5, + PinName d2 = PTC8, + PinName d3 = PTC9, + PinName bl = PTA12, + PinName a0 = PTB0); + + void setCursorPosition (int line, int col); + void setBackLight (bool blStatus); + void setBackLight (float blIntensity); + void setCursor (bool cStatus, bool blink = false); + void shift (bool left); + void cls (void); + void home(void); + + float readButton(void); + + protected: + // Stream implementation functions + virtual int _putc(int value); + virtual int _getc(); +}; \ No newline at end of file