Tadao Iida / Mbed 2 deprecated TextLCD_SlideMessage

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
sunifu
Date:
Wed Sep 22 12:52:23 2010 +0000
Commit message:

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
diff -r 000000000000 -r d4893e58d648 TextLCD.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Wed Sep 22 12:52:23 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/TextLCD/#a53b3e2d6f1e
diff -r 000000000000 -r d4893e58d648 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Sep 22 12:52:23 2010 +0000
@@ -0,0 +1,48 @@
+#include "mbed.h"
+#include "TextLCD.h"
+
+void slideMessage(char* ,double ,int );
+//slideMessage(message, slidetime, row )
+ 
+TextLCD lcd(p24,p26,p27,p28,p29,p30);
+#define SIZE 16
+// I don't test TextLCD 20x ... 16x2B
+
+int main() {
+    char msg[] = "1234567890123456" ;
+    char msg1[] = "Welcome to mbed! mbed is a tool for Rapid Prototyping with Microcontrollers." ;
+    slideMessage(msg1, 0.5,0);
+    return 0 ;
+}
+
+void slideMessage(char msg[], double time,int row)
+{
+    int j, k ;   
+    int len = ( strlen(msg) ) ;
+    
+    lcd.cls();
+ 
+    while(1){        
+        for (j = SIZE -1  ; j>=0 ; j-- ){
+            for ( k = j ; k < SIZE ; k++ ){
+                lcd.locate(k,row);
+                if ( len  > (k - j) )
+                    lcd.printf("%c",msg[k-j]) ;
+                else
+                    lcd.printf(" ") ;
+            }          
+            wait(time) ;
+        }
+ 
+        for ( j = 1 ; j <= len  ; j++ ){
+            for ( k = 0; k < SIZE ; k++ ){
+                lcd.locate(k,row) ;
+                if( ( k + j ) < len )
+                    lcd.printf("%c",msg[k+j]) ;
+                else
+                    lcd.printf(" ") ;
+            }
+            wait(time) ;
+        }    
+    }   
+}
diff -r 000000000000 -r d4893e58d648 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Sep 22 12:52:23 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e