SLIM BEN OTHMAN / Mbed 2 deprecated LCD_test

Dependencies:   TextLCD mbed

Fork of LCD_test by Rain Ashford

Files at this revision

API Documentation at this revision

Comitter:
slimbenothman
Date:
Mon Jun 04 08:46:31 2018 +0000
Parent:
0:2e3ae6cbbe60
Commit message:
print shifted message to LCD

Changed in this revision

TextLCD.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Mon Jun 04 08:46:31 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/TextLCD/#308d188a2d3a
--- a/main.cpp	Mon Apr 05 21:43:07 2010 +0000
+++ b/main.cpp	Mon Jun 04 08:46:31 2018 +0000
@@ -1,28 +1,21 @@
-
-
 #include "mbed.h"
 #include "TextLCD.h"
 
-TextLCD lcd(p24, p25, p26, p27, p28, p29, p30); // rs, rw, e, d0, d1, d2, d3
+TextLCD lcd(PA_9, PC_7, PB_5, PB_4, PB_10, PA_8); // rs, e, d4-d7
+
+char *message = "                Hello there mousie!";
 
-const char *message = "                Hello there mousie!";
-
-int main() {
-    //lcd.printf("Yay! Woo! from  Rainycat!");
+int main()
+{
+    lcd.printf("Yay! Woo! from  Rainycat!");
+    int i=0;
     while (1) {
-    int i;
-    for (i = 0; message[i]; i++) {
-        lcd.locate(0,0);
-        int j, k = i;
-        for (j = 0; j < 15; j++) {
-            if (message[k+j]) {
-                lcd.putc(message[k+j]);
-            } else {
-                lcd.putc(' ');
-                k--;
-            }
-        }
+        lcd.locate(1,0);
+        lcd.printf(message);
+        message=message+1;
+        i++;
+        if (i == strlen(message))
+            strcpy(message, "                Hello there mousie!");
         wait_ms(450);
-    }    
     }
 }
--- a/mbed.bld	Mon Apr 05 21:43:07 2010 +0000
+++ b/mbed.bld	Mon Jun 04 08:46:31 2018 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/49a220cc26e0
+http://mbed.org/users/mbed_official/code/mbed/builds/5aab5a7997ee
\ No newline at end of file