Skip to content

Commit e43f423

Browse files
author
dave
committed
Improvement to mbed example
1 parent 0162da2 commit e43f423

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/helloMbed/helloMbed.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@
1212
#include <TaskManager.h>
1313
#include "LiquidCrystalIO.h"
1414

15-
// set up the pins that you'll use with the i2cbackpack.
15+
// set up the pins that you'll use with the i2c backpack.
1616
// there's two common arrangement. RS RW EN and EN RW RS
1717
const int rs = 0, en = 2, d4 = 4, d5 = 5, d6 = 6, d7 = 7;
1818
//const int rs = 2, en = 1, d4 = 4, d5 = 5, d6 = 6, d7 = 7;
1919

2020
const int lcdWidth = 16;
2121
const int lcdHeight = 2;
2222

23-
LiquidCrystal lcd(rs, en, d4, d5, d6, d7, ioFrom8574(0x20));
23+
I2C i2c(PF_0, PF_1);
24+
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
2425

2526
const uint8_t smiley[8] = {
2627
0b00000,
@@ -36,7 +37,7 @@ const uint8_t smiley[8] = {
3637
int oldPos = 0;
3738

3839
int main() {
39-
Wire.begin();
40+
lcd.setIoAbstraction(ioFrom8574(0x4E, 0xff, &i2c));
4041
lcd.configureBacklightPin(3);
4142
lcd.setBacklight(true);
4243

@@ -65,7 +66,6 @@ int main() {
6566
// by first clearing the last position
6667
lcd.setCursor(oldPos,2);
6768
lcd.print(' ');
68-
6969
});
7070

7171
while(1) {

0 commit comments

Comments
 (0)