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.
Diff: I2CTextLCD.cpp
- Revision:
- 5:4a4cea387d8e
- Parent:
- 4:d3b7c4237e9d
- Child:
- 6:bc76b6a20bfb
--- a/I2CTextLCD.cpp Fri Aug 26 12:39:38 2011 +0000
+++ b/I2CTextLCD.cpp Sat Aug 27 09:50:50 2011 +0000
@@ -48,27 +48,33 @@
wait(0.05);
// send "Display Settings" 3 times (Only top nibble of 0x30 as we've got 4-bit bus)
for (int i=0; i<3; i++) {
- writeCommand(0x3); //send 3 times mode
+// writeCommand(0x3); //send 3 times mode
wait(0.00164); // this command takes 1.64ms, so wait for it
}
writeCommand(0x2); // 4-bit mode
wait(0.01);
- writeCommand(0x2); // 4-bit mode
+// writeCommand(0x2); // 4-bit mode
writeCommand(0x28); // Function set 001 BW N F - -
wait(0.01);
- writeCommand(0x28); // Function set 001 BW N F
+// writeCommand(0x28); // Function set 001 BW N F
wait(0.01);
writeCommand(0x0C); // ON-OFF ctrl: turns display ON, no cursor. Use 0x0E for cursor ON.
/* 0x28 also works for Winstar WEH002004ALPP5N00000 OLED display. 0x29= westEuro fon table, 0x2A = UK/Russian
*/
// Added RC 2011-8-11
writeCommand(0x01); // clear display RAM all to 00
- wait(0.01); // 6.2ms specified for OLED display to recover from RAM clear
+ wait(0.05); // 6.2ms specified for OLED display to recover from RAM clear
writeCommand(0x06); // Entry mode Set. Cursor Direction and Display Shift : 0000 01 CD S (CD 0-left, 1-right S(hift) 0-no, 1-yes
-
- cls();
+ wait(0.01);
+ writeCommand(0x14); // OLED display shift disable etc
+ wait(0.01);
+ writeCommand(0x17); // disable graphic mode, power ON
+ //cls();
+ wait(0.01);
+ writeCommand (0x01); //clear entire display.
+ wait(0.07);
}