Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
AMC1602/AMC1602.h@4:143f36e83ad5, 2015-10-19 (annotated)
- Committer:
- vhsstar
- Date:
- Mon Oct 19 20:53:47 2015 +0000
- Revision:
- 4:143f36e83ad5
Hoebag
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| vhsstar | 4:143f36e83ad5 | 1 | #ifndef AMC1602_H |
| vhsstar | 4:143f36e83ad5 | 2 | #define AMC1602_H |
| vhsstar | 4:143f36e83ad5 | 3 | |
| vhsstar | 4:143f36e83ad5 | 4 | #include "mbed.h" |
| vhsstar | 4:143f36e83ad5 | 5 | |
| vhsstar | 4:143f36e83ad5 | 6 | class AMC1602 |
| vhsstar | 4:143f36e83ad5 | 7 | { |
| vhsstar | 4:143f36e83ad5 | 8 | public: |
| vhsstar | 4:143f36e83ad5 | 9 | //Create an AMC1602 object on the I2C pins:(sda, scl), with the I2C address:(screenAddress) |
| vhsstar | 4:143f36e83ad5 | 10 | AMC1602(PinName sda, PinName scl, char screenAddress); |
| vhsstar | 4:143f36e83ad5 | 11 | |
| vhsstar | 4:143f36e83ad5 | 12 | //print whatever's in the textBuffer onto the screen |
| vhsstar | 4:143f36e83ad5 | 13 | void print(); |
| vhsstar | 4:143f36e83ad5 | 14 | |
| vhsstar | 4:143f36e83ad5 | 15 | //print two lines from a 32 character string |
| vhsstar | 4:143f36e83ad5 | 16 | void print(char* message); |
| vhsstar | 4:143f36e83ad5 | 17 | |
| vhsstar | 4:143f36e83ad5 | 18 | //print the top line from a 16 character string |
| vhsstar | 4:143f36e83ad5 | 19 | void printTop(char* message); |
| vhsstar | 4:143f36e83ad5 | 20 | |
| vhsstar | 4:143f36e83ad5 | 21 | //print the bottom line from a 16 character string |
| vhsstar | 4:143f36e83ad5 | 22 | void printBottom(char* message); |
| vhsstar | 4:143f36e83ad5 | 23 | |
| vhsstar | 4:143f36e83ad5 | 24 | |
| vhsstar | 4:143f36e83ad5 | 25 | //BITMAP FUNCTIONS |
| vhsstar | 4:143f36e83ad5 | 26 | //NO GARUNTEES OF WORKING |
| vhsstar | 4:143f36e83ad5 | 27 | |
| vhsstar | 4:143f36e83ad5 | 28 | //read a bitmap with the string filename |
| vhsstar | 4:143f36e83ad5 | 29 | //returns a string of the file contents (top left corner first) |
| vhsstar | 4:143f36e83ad5 | 30 | char* readBitmap(char* filename); |
| vhsstar | 4:143f36e83ad5 | 31 | |
| vhsstar | 4:143f36e83ad5 | 32 | //read a bitmap with the string file contents buffer(80x16) |
| vhsstar | 4:143f36e83ad5 | 33 | void printBitmap(char* buffer); |
| vhsstar | 4:143f36e83ad5 | 34 | |
| vhsstar | 4:143f36e83ad5 | 35 | //get a character from an images buffer |
| vhsstar | 4:143f36e83ad5 | 36 | void getChar(char* buffer, int x, int y); |
| vhsstar | 4:143f36e83ad5 | 37 | |
| vhsstar | 4:143f36e83ad5 | 38 | |
| vhsstar | 4:143f36e83ad5 | 39 | private: |
| vhsstar | 4:143f36e83ad5 | 40 | //The I2C object used for sneding data to the screen |
| vhsstar | 4:143f36e83ad5 | 41 | I2C bus; |
| vhsstar | 4:143f36e83ad5 | 42 | |
| vhsstar | 4:143f36e83ad5 | 43 | //The I2C address of the screen |
| vhsstar | 4:143f36e83ad5 | 44 | char address; |
| vhsstar | 4:143f36e83ad5 | 45 | |
| vhsstar | 4:143f36e83ad5 | 46 | //a buffer of the charcters to be written |
| vhsstar | 4:143f36e83ad5 | 47 | char textBuffer[32]; |
| vhsstar | 4:143f36e83ad5 | 48 | |
| vhsstar | 4:143f36e83ad5 | 49 | //Buffer of all the bitmap (monochrome) data to be printed to the screen |
| vhsstar | 4:143f36e83ad5 | 50 | //16 characters wide, each 5 pixels, with 15 pixel spaces between |
| vhsstar | 4:143f36e83ad5 | 51 | //2 charcters tall, with a 1 pixel space between |
| vhsstar | 4:143f36e83ad5 | 52 | //8 bits in a char |
| vhsstar | 4:143f36e83ad5 | 53 | char imageBuffer[320]; |
| vhsstar | 4:143f36e83ad5 | 54 | }; |
| vhsstar | 4:143f36e83ad5 | 55 | #endif |

