Șimon Paul
/
I2C-LCD
test
main.cpp@0:376d7a150177, 2014-12-03 (annotated)
- Committer:
- oscarvzfz
- Date:
- Wed Dec 03 03:48:48 2014 +0000
- Revision:
- 0:376d7a150177
- Child:
- 1:df10d37c417d
i2c lcd; ;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
oscarvzfz | 0:376d7a150177 | 1 | #include "mbed.h" |
oscarvzfz | 0:376d7a150177 | 2 | #include "TextLCD.h" |
oscarvzfz | 0:376d7a150177 | 3 | //Incluye resistencias de 2.2K en los pines de i2c a 3.3 |
oscarvzfz | 0:376d7a150177 | 4 | |
oscarvzfz | 0:376d7a150177 | 5 | |
oscarvzfz | 0:376d7a150177 | 6 | |
oscarvzfz | 0:376d7a150177 | 7 | // I2C Communication |
oscarvzfz | 0:376d7a150177 | 8 | I2C i2c_lcd(p28,p27); // SDA, SCL |
oscarvzfz | 0:376d7a150177 | 9 | |
oscarvzfz | 0:376d7a150177 | 10 | TextLCD_I2C lcd(&i2c_lcd, 0x4E, TextLCD::LCD16x2, TextLCD::HD44780); // I2C bus, PCF8574 Slaveaddress, LCD Type, Device Type |
oscarvzfz | 0:376d7a150177 | 11 | |
oscarvzfz | 0:376d7a150177 | 12 | |
oscarvzfz | 0:376d7a150177 | 13 | int main() |
oscarvzfz | 0:376d7a150177 | 14 | { |
oscarvzfz | 0:376d7a150177 | 15 | lcd.setMode(TextLCD::DispOn); //DispOff, DispOn |
oscarvzfz | 0:376d7a150177 | 16 | lcd.setBacklight(TextLCD::LightOff);//LightOff, LightOn |
oscarvzfz | 0:376d7a150177 | 17 | lcd.setCursor(TextLCD::CurOff_BlkOff);//CurOff_BlkOff, CurOn_BlkOff, CurOff_BlkOn, CurOn_BlkOn |
oscarvzfz | 0:376d7a150177 | 18 | lcd.printf("Oscar de Jesus \n Vasquez"); |
oscarvzfz | 0:376d7a150177 | 19 | |
oscarvzfz | 0:376d7a150177 | 20 | } |