Wim Huiskamp / Mbed 2 deprecated mbed_TM1638

Dependencies:   TM1638 mbed

Revision:
2:d6720abfe574
Parent:
1:12dadbc0017d
Child:
3:f1484bfa0574
diff -r 12dadbc0017d -r d6720abfe574 main.cpp
--- a/main.cpp	Sat Jan 09 14:34:16 2016 +0000
+++ b/main.cpp	Fri Jan 15 19:10:16 2016 +0000
@@ -1,5 +1,6 @@
 /* mbed TM1638 Test program, for TM1638 LED controller
  * Copyright (c) 2015, v01: WH, Initial version
+ *               2016, v02: WH, Added ASCII alphabet test 
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -103,16 +104,30 @@
 //          LEDKEY8.cls(); 
 //          LEDKEY8.writeData(mbed_str);
 
-#if(0)
+#if(1)
+//test to show all chars
+          pc.printf("Show all alpha chars\r\n");
+          wait(1);          
+          LEDKEY8.cls(); 
+         
+          for (int i=0; i<26; i++) {
+            LEDKEY8.printf("%c", char(i + 'A'));
+//            LEDKEY8.printf("%c", char(i + 'a'));            
+            wait(0.25);                      
+          }
+          pc.printf("Show all alpha chars done\r\n");                    
+#endif            
+
+#if(1)
 //test to show all chars
           pc.printf("Show all chars\r\n");
           wait(1);          
           LEDKEY8.cls(); 
-         
-          for (int i=0; i<26; i++) {
-            LEDKEY8.writeData(0, FONT_16S[i][0]);
-            LEDKEY8.writeData(1, FONT_16S[i][1]);
-            wait(1);                      
+
+          for (int i=FONT_7S_START; i<FONT_7S_END; i++) {
+            LEDKEY8.printf("%c", char(i));
+//            wait(0.25);
+            cmd = pc.getc(); // wait for key            
           }
           pc.printf("Show all chars done\r\n");                    
 #endif            
@@ -203,12 +218,14 @@
 
         if (keydata[LEDKEY8_SW5_IDX] == LEDKEY8_SW5_BIT) { //sw5  
           LEDKEY8.cls(); // clear all, preserve Icons
-          LEDKEY8.writeData(hello_str);           
+//          LEDKEY8.writeData(hello_str);
+          LEDKEY8.printf("hello");                  
         }
 
         if (keydata[LEDKEY8_SW6_IDX] == LEDKEY8_SW6_BIT) { //sw6  
           LEDKEY8.cls(); // clear all, preserve Icons
-          LEDKEY8.writeData(bye_str);                   
+//          LEDKEY8.writeData(bye_str);
+          LEDKEY8.printf("Bye");          
         }
         
         if (keydata[LEDKEY8_SW7_IDX] == LEDKEY8_SW7_BIT) { //sw7