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.
Revision 4:ac48711f123b, committed 2022-11-18
- Comitter:
- henriquer
- Date:
- Fri Nov 18 18:00:26 2022 +0000
- Parent:
- 3:e87183be497b
- Commit message:
- Teste LCD I2C 20X4
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Nov 18 13:51:29 2022 +0000
+++ b/main.cpp Fri Nov 18 18:00:26 2022 +0000
@@ -19,7 +19,7 @@
//TextLCD lcd(p15, p16, p17, p18, p19, p20); // RS, E, D4-D7, LCDType=LCD16x2, BL=NC, E2=NC, LCDTCtrl=HD44780
//I2C Portexpander PCF8574
-TextLCD_I2C lcd(&i2c_lcd, 0xbf, TextLCD::LCD20x4); // I2C bus, PCF8574 Slaveaddress, LCD Type Original = 0x42, Usando I2C scanner = 0x3F
+TextLCD_I2C lcd(&i2c_lcd, 0x7E, TextLCD::LCD20x4); // I2C bus, PCF8574 Slaveaddress, LCD Type Original = 0x42, Usando I2C scanner = 0x3F
//TextLCD_I2C lcd(&i2c_lcd, 0x7e, TextLCD::LCD16x2, TextLCD::WS0010); // I2C bus, PCF8574 addr, LCD Type, Ctrl Type
//I2C Portexpander MCP23008
@@ -49,46 +49,33 @@
int main() {
pc.printf("LCD Test. Columns=%d, Rows=%d\n\r", lcd.columns(), lcd.rows());
- for (int row=0; row<lcd.rows(); row++) {
- int col=0;
+ // for (int row=0; row<lcd.rows(); row++) {
+ // int col=0;
- pc.printf("MemAddr(Col=%d, Row=%d)=0x%02X\n\r", col, row, lcd.getAddress(col, row));
+ // pc.printf("MemAddr(Col=%d, Row=%d)=0x%02X\n\r", col, row, lcd.getAddress(col, row));
// lcd.putc('-');
- lcd.putc('0' + row);
+ //lcd.putc('l' + row);
- for (col=1; col<lcd.columns()-1; col++) {
- lcd.putc('*');
- }
+ // for (col=1; col<lcd.columns()-1; col++) {
+ lcd.locate(2,0);
+ lcd.printf("TESTE LCD 20X4");
+
+ lcd.locate(4,2);
+ lcd.printf("HENRIQUE");
+ //}
- pc.printf("MemAddr(Col=%d, Row=%d)=0x%02X\n\r", col, row, lcd.getAddress(col, row));
- lcd.putc('+');
- }
+ /// pc.printf("MemAddr(Col=%d, Row=%d)=0x%02X\n\r", col, row, lcd.getAddress(col, row));
+ // lcd.putc('+');
+ // }
// Show cursor as blinking character
+
+
+
lcd.setCursor(TextLCD::CurOff_BlkOn);
lcd.setBacklight(TextLCD::LightOn);
//lcd.setUDC(0, (char *) udc_AC); // Show |>
-
+ //lcd.putc('LTH');
-// Set and show user defined characters. A maximum of 8 UDCs are supported by the HD44780.
-// They are defined by a 5x7 bitpattern.
-/*
- lcd.setUDC(0, (char *) udc_0); // Show |>
- lcd.putc(0);
- lcd.setUDC(1, (char *) udc_1); // Show <|
- lcd.putc(1);
- lcd.setUDC(2, (char *) udc_2);
- lcd.putc(2);
- lcd.setUDC(3, (char *) udc_3);
- lcd.putc(3);
- lcd.setUDC(4, (char *) udc_4);
- lcd.putc(4);
- lcd.setUDC(5, (char *) udc_5);
- lcd.putc(5);
- lcd.setUDC(6, (char *) udc_6);
- lcd.putc(6);
- lcd.setUDC(7, (char *) udc_7);
- lcd.putc(7);
- //lcd.setBacklight(TextLCD::LightOn);
- */
+
}
\ No newline at end of file