Mangue Baja LCD example (default and I2C) for stm32.
Dependencies: TextLCD SDFileSystem1
main.cpp@1:17cdefd2840d, 2019-08-02 (annotated)
- Committer:
- einsteingustavo
- Date:
- Fri Aug 02 00:30:08 2019 +0000
- Revision:
- 1:17cdefd2840d
- Parent:
- 0:2f38376349e5
- Child:
- 2:d40e91c72c0b
Mangue Baja LCD example (default and I2C) for stm32.
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 | 1:17cdefd2840d | 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 |
einsteingustavo | 1:17cdefd2840d | 10 | */ |
danilloaguiar | 0:2f38376349e5 | 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 |
danilloaguiar | 0:2f38376349e5 | 14 | |
danilloaguiar | 0:2f38376349e5 | 15 | int main() |
danilloaguiar | 0:2f38376349e5 | 16 | { |
danilloaguiar | 0:2f38376349e5 | 17 | lcd.setMode(TextLCD::DispOn); //DispOff, DispOn |
danilloaguiar | 0:2f38376349e5 | 18 | lcd.setBacklight(TextLCD::LightOff);//LightOff, LightOn |
danilloaguiar | 0:2f38376349e5 | 19 | lcd.setCursor(TextLCD::CurOff_BlkOff);//CurOff_BlkOff, CurOn_BlkOff, CurOff_BlkOn, CurOn_BlkOn |
danilloaguiar | 0:2f38376349e5 | 20 | lcd.printf("123456789123456789"); |
danilloaguiar | 0:2f38376349e5 | 21 | } |