Mangue Baja LCD example (default and I2C) for stm32.
Dependencies: TextLCD SDFileSystem1
main.cpp@2:d40e91c72c0b, 2022-09-21 (annotated)
- Committer:
- einsteingustavo
- Date:
- Wed Sep 21 22:52:09 2022 +0000
- Revision:
- 2:d40e91c72c0b
- Parent:
- 1:17cdefd2840d
2022 Commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
danilloaguiar | 0:2f38376349e5 | 1 | #include "mbed.h" |
danilloaguiar | 0:2f38376349e5 | 2 | #include "TextLCD.h" |
danilloaguiar | 0:2f38376349e5 | 3 | |
danilloaguiar | 0:2f38376349e5 | 4 | DigitalOut myled(PC_13); |
danilloaguiar | 0:2f38376349e5 | 5 | |
danilloaguiar | 0:2f38376349e5 | 6 | |
einsteingustavo | 2:d40e91c72c0b | 7 | //I2C Communication |
danilloaguiar | 0:2f38376349e5 | 8 | I2C i2c_lcd(PB_9, PB_8); // SDA, SCL |
danilloaguiar | 0:2f38376349e5 | 9 | TextLCD_I2C lcd(&i2c_lcd, 0x4E, TextLCD::LCD16x2, TextLCD::HD44780); // I2C bus, PCF8574 Slaveaddress, LCD Type, Device Type |
danilloaguiar | 0:2f38376349e5 | 10 | |
einsteingustavo | 2:d40e91c72c0b | 11 | /* |
einsteingustavo | 1:17cdefd2840d | 12 | //Default LCD Communication |
einsteingustavo | 1:17cdefd2840d | 13 | TextLCD lcd(PA_5, PA_6, PA_7, PA_8, PA_9, PA_10); // rs, e, d4, d5, d6, d7 |
einsteingustavo | 2:d40e91c72c0b | 14 | */ |
danilloaguiar | 0:2f38376349e5 | 15 | |
danilloaguiar | 0:2f38376349e5 | 16 | int main() |
danilloaguiar | 0:2f38376349e5 | 17 | { |
danilloaguiar | 0:2f38376349e5 | 18 | lcd.setMode(TextLCD::DispOn); //DispOff, DispOn |
danilloaguiar | 0:2f38376349e5 | 19 | lcd.setBacklight(TextLCD::LightOff);//LightOff, LightOn |
danilloaguiar | 0:2f38376349e5 | 20 | lcd.setCursor(TextLCD::CurOff_BlkOff);//CurOff_BlkOff, CurOn_BlkOff, CurOff_BlkOn, CurOn_BlkOn |
danilloaguiar | 0:2f38376349e5 | 21 | lcd.printf("123456789123456789"); |
danilloaguiar | 0:2f38376349e5 | 22 | } |