Library for Matrix Orbital VFD2041 display. Also useable for LCD2041 modules.
Revision 3:b96f8fff00e8, committed 2012-03-10
- Comitter:
- wsalis01
- Date:
- Sat Mar 10 22:18:27 2012 +0000
- Parent:
- 2:b170a67a8dae
- Child:
- 4:f17ce5ab5d01
- Commit message:
Changed in this revision
VFD.cpp | Show annotated file Show diff for this revision Revisions of this file |
VFD.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/VFD.cpp Mon Mar 05 21:20:40 2012 +0000 +++ b/VFD.cpp Sat Mar 10 22:18:27 2012 +0000 @@ -9,6 +9,10 @@ //Nothing to see here } +VFD::VFD(PinName data, PinName clock) : _i2c(data, clock) { + //Nothing to see here +} + VFD::~VFD() { //Nothing to see here } @@ -123,7 +127,7 @@ * @returns I2C write return value */ int VFD::write(const char * data, int length) { - int ret = _i2c.write(address, data, length); //Performs a complete write transaction + int ret = _i2c.write(ADDRESS, data, length); //Performs a complete write transaction wait_us(625); return ret; //Return I2C.write(...) return value } @@ -134,7 +138,7 @@ * @returns I2C read return value */ int VFD::read(char * data, int length) { - int ret = _i2c.read(address, data, length); //Performs a complete write transaction + int ret = _i2c.read(ADDRESS, data, length); //Performs a complete write transaction wait_us(625); return ret; //Return I2C.write(...) return value } \ No newline at end of file
--- a/VFD.h Mon Mar 05 21:20:40 2012 +0000 +++ b/VFD.h Sat Mar 10 22:18:27 2012 +0000 @@ -14,11 +14,12 @@ const PinName SDA = p28; const PinName SCL = p27; -const int address = 0x50; +const int ADDRESS = 0x50; class VFD { public: VFD(); + VFD(PinName data, PinName clock); ~VFD(); int init(); int print(string msg);