cristian vega
/
LCD_HD44780
test
main.cpp@5:b8848a42df31, 2020-05-09 (annotated)
- Committer:
- cristianve
- Date:
- Sat May 09 12:38:29 2020 +0000
- Revision:
- 5:b8848a42df31
- Parent:
- 4:a3e4bb2053cb
first commit;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wim | 4:a3e4bb2053cb | 1 | /* Hello World! for the TextLCD Enhanced Library*/ |
wim | 0:a75049de1a82 | 2 | |
wim | 0:a75049de1a82 | 3 | #include "mbed.h" |
wim | 0:a75049de1a82 | 4 | #include "TextLCD.h" |
wim | 4:a3e4bb2053cb | 5 | |
wim | 0:a75049de1a82 | 6 | // Host PC Communication channels |
wim | 0:a75049de1a82 | 7 | Serial pc(USBTX, USBRX); // tx, rx |
wim | 4:a3e4bb2053cb | 8 | |
wim | 0:a75049de1a82 | 9 | // I2C Communication |
cristianve | 5:b8848a42df31 | 10 | I2C i2c_lcd(PTE0,PTE1); // SDA, SCL |
wim | 0:a75049de1a82 | 11 | |
wim | 4:a3e4bb2053cb | 12 | // LCD instantiation |
cristianve | 5:b8848a42df31 | 13 | TextLCD_I2C lcd(&i2c_lcd, 0x4E, TextLCD::LCD16x2); |
cristianve | 5:b8848a42df31 | 14 | int main() { |
wim | 4:a3e4bb2053cb | 15 | |
cristianve | 5:b8848a42df31 | 16 | Timer t; |
cristianve | 5:b8848a42df31 | 17 | time_t seconds = time(NULL); |
cristianve | 5:b8848a42df31 | 18 | char buffer[32]; |
cristianve | 5:b8848a42df31 | 19 | strftime(buffer, 32, "%I:%M %p\n", ); |
cristianve | 5:b8848a42df31 | 20 | lcd.printf(" %s", buffer); |
wim | 4:a3e4bb2053cb | 21 | |
cristianve | 5:b8848a42df31 | 22 | //lcd.printf("Hello World!"); |
wim | 4:a3e4bb2053cb | 23 | } |
wim | 3:f238b4f7874f | 24 | |
wim | 3:f238b4f7874f | 25 | |
wim | 0:a75049de1a82 | 26 |