AQM1602 library
Dependents: mbed_AQM1602 CatPot_Main_T_2v00 CatPot_2v10_T_Main CatPot_2v20_T_Main ... more
See https://developer.mbed.org/users/yasuyuki/notebook/AQM1602/
AQM1602.h@0:4c3df2da124c, 2015-03-06 (annotated)
- Committer:
- yasuyuki
- Date:
- Fri Mar 06 12:51:41 2015 +0000
- Revision:
- 0:4c3df2da124c
release
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yasuyuki | 0:4c3df2da124c | 1 | //********************** |
yasuyuki | 0:4c3df2da124c | 2 | // AQM1602.h for mbed |
yasuyuki | 0:4c3df2da124c | 3 | // |
yasuyuki | 0:4c3df2da124c | 4 | // (C)Copyright 2015 All rights reserved by Y.Onodera |
yasuyuki | 0:4c3df2da124c | 5 | // http://einstlab.web.fc2.com |
yasuyuki | 0:4c3df2da124c | 6 | //********************** |
yasuyuki | 0:4c3df2da124c | 7 | |
yasuyuki | 0:4c3df2da124c | 8 | #ifndef AQM1602_H_ |
yasuyuki | 0:4c3df2da124c | 9 | #define AQM1602_H_ |
yasuyuki | 0:4c3df2da124c | 10 | |
yasuyuki | 0:4c3df2da124c | 11 | #define AQM1602_ADDR 0x7c |
yasuyuki | 0:4c3df2da124c | 12 | #define CMD 0x00 |
yasuyuki | 0:4c3df2da124c | 13 | #define DAT 0x40 |
yasuyuki | 0:4c3df2da124c | 14 | |
yasuyuki | 0:4c3df2da124c | 15 | #include "mbed.h" |
yasuyuki | 0:4c3df2da124c | 16 | |
yasuyuki | 0:4c3df2da124c | 17 | //class AQM1602: public Stream{ |
yasuyuki | 0:4c3df2da124c | 18 | class AQM1602{ |
yasuyuki | 0:4c3df2da124c | 19 | public: |
yasuyuki | 0:4c3df2da124c | 20 | AQM1602 (PinName sda, PinName scl); |
yasuyuki | 0:4c3df2da124c | 21 | AQM1602 (I2C& p_i2c); |
yasuyuki | 0:4c3df2da124c | 22 | void init(); |
yasuyuki | 0:4c3df2da124c | 23 | |
yasuyuki | 0:4c3df2da124c | 24 | void put(unsigned char a, unsigned char b); |
yasuyuki | 0:4c3df2da124c | 25 | void get(unsigned char a); |
yasuyuki | 0:4c3df2da124c | 26 | void cls(); |
yasuyuki | 0:4c3df2da124c | 27 | void locate (int x, int y); |
yasuyuki | 0:4c3df2da124c | 28 | void print (const char* a); |
yasuyuki | 0:4c3df2da124c | 29 | |
yasuyuki | 0:4c3df2da124c | 30 | protected: |
yasuyuki | 0:4c3df2da124c | 31 | |
yasuyuki | 0:4c3df2da124c | 32 | I2C _i2c; |
yasuyuki | 0:4c3df2da124c | 33 | // virtual int _putc(int value); |
yasuyuki | 0:4c3df2da124c | 34 | // virtual int _getc(); |
yasuyuki | 0:4c3df2da124c | 35 | |
yasuyuki | 0:4c3df2da124c | 36 | char buf[2]; |
yasuyuki | 0:4c3df2da124c | 37 | |
yasuyuki | 0:4c3df2da124c | 38 | }; |
yasuyuki | 0:4c3df2da124c | 39 | |
yasuyuki | 0:4c3df2da124c | 40 | |
yasuyuki | 0:4c3df2da124c | 41 | #endif /* AQM1602_H_ */ |
yasuyuki | 0:4c3df2da124c | 42 |