LCD example for NXP Rapid IoT Prototyping kit using hexiwear SDK. Read more at https://www.hackster.io/marcomerli/riotwear-mbed-2b2011.

Dependencies:   GraphicsDisplay ColorMemLCD Large_fonts

Files at this revision

API Documentation at this revision

Comitter:
batman52
Date:
Fri Nov 29 16:46:40 2019 +0000
Parent:
1:19961b4a7239
Commit message:
LCD example for NXP Rapid IoT Prototyping kit, using hexiwear SDK

Changed in this revision

ColorMemLCD.lib Show annotated file Show diff for this revision Revisions of this file
Large_fonts.lib Show annotated file Show diff for this revision Revisions of this file
SDFileSystem.lib Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show diff for this revision Revisions of this file
diff -r 19961b4a7239 -r 25d611652243 ColorMemLCD.lib
--- a/ColorMemLCD.lib	Thu Jun 23 02:35:10 2016 +0000
+++ b/ColorMemLCD.lib	Fri Nov 29 16:46:40 2019 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/users/KURETA90/code/ColorMemLCD/#76a4e97c113f
+http://developer.mbed.org/users/KURETA90/code/ColorMemLCD/#b035a997ec3f
diff -r 19961b4a7239 -r 25d611652243 Large_fonts.lib
--- a/Large_fonts.lib	Thu Jun 23 02:35:10 2016 +0000
+++ b/Large_fonts.lib	Fri Nov 29 16:46:40 2019 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/users/KURETA90/code/Large_fonts/#add704079a90
+https://os.mbed.com/users/batman52/code/Large_fonts/#27fb360a2622
diff -r 19961b4a7239 -r 25d611652243 SDFileSystem.lib
--- a/SDFileSystem.lib	Thu Jun 23 02:35:10 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://developer.mbed.org/users/mbed_official/code/SDFileSystem/#7b35d1709458
diff -r 19961b4a7239 -r 25d611652243 main.cpp
--- a/main.cpp	Thu Jun 23 02:35:10 2016 +0000
+++ b/main.cpp	Fri Nov 29 16:46:40 2019 +0000
@@ -1,7 +1,6 @@
 #include "stdio.h"
 #include "mbed.h"
 #include "ColorMemLCD.h"
-//#include "SDFileSystem.h"
 
 #include "string"
 #include "Prototype24x27.h"
@@ -15,14 +14,24 @@
 #include "symb_block.h"
 #include "symb_block_rev.h"
 
-//SDFileSystem        sd( PTE3, PTE1, PTE2, PTE4, "sd" );          // mosi,miso,sck,cs
-ColorMemLCD    LCD( PTD2, PTD3, PTD1, PTD0, PTC4, PTD3, "TFT" );   // mosi, miso, sclk, cs, reset, (power)
+DigitalOut     lcd_light(PTE12, 1); // 1 = ON, 0 = OFF
+               //    mosi,  miso,  sclk,    cs, reset, power
+ColorMemLCD    LCD( PTB22, PTB23, PTB21, PTB20, PTD15,  PTD9, "TFT");
+
+#if(1)
+#define WAIT_S(x) wait(x)
+#else
+#define WAIT_S(x) Thread::wait(x*1000)
+#endif
+
 Ticker pollingTimer;
 
+/*
 void pollingTimerHandler()
 {
     LCD.polling();
 }
+*/
 
 int main()
 {
@@ -31,12 +40,9 @@
     int Divide = 8;                // separate for 8 windows to save memory
     int Block = LCD_DISP_HEIGHT / Divide; 
 
-    pollingTimer.attach( &pollingTimerHandler, 1.0 );
+    // pollingTimer.attach( &pollingTimerHandler, 1.0 );
     LCD.command_AllClear();
     
-    /*  SD read  */
-    //LCD.BMP_24(0,0,"/sd/sample.bmp");
-
     while(1) {
         
         /* Turn white - whole the screen */
@@ -58,7 +64,7 @@
         LCD.set_font( (unsigned char*)Prototype24x27 );
         LCD.printf("Hello");
         LCD.update();
-        wait(0.8);      
+        WAIT_S(0.8);
 
         /* world */  
         pic_height = 88;
@@ -74,22 +80,22 @@
             LCD.Bitmap4bit( 0, 60, 176, pic_height, (unsigned char *)bmp_leaf_4bit );
             LCD.update();
         }
-        wait(0.8);
+        WAIT_S(0.8);
         
         LCD.fillcircle(  40, 136, 18, LCD_COLOR_WHITE );
-        LCD.update();
-        wait(1); 
+        LCD.update();        
+        WAIT_S(1);         
         LCD.fillcircle( 160, 122, 12, LCD_COLOR_WHITE );
-        LCD.update();
-        wait(0.2); 
+        LCD.update();        
+        WAIT_S(0.2); 
         LCD.fillcircle( 120, 132, 14, LCD_COLOR_WHITE );
         LCD.update();   
-        wait(1); 
+        WAIT_S(1);     
                 
-        LCD.setBlinkMode( LCD_BLINKMODE_INVERSE );
-        wait(0.2); 
+        LCD.setBlinkMode( LCD_BLINKMODE_INVERSE );        
+        WAIT_S(0.2); 
         LCD.setBlinkMode( LCD_BLINKMODE_NONE );
-        wait(0.2);        
+        WAIT_S(0.2);         
        
         /*  Cube  */
         LCD.background( LCD_COLOR_WHITE);        
@@ -103,13 +109,13 @@
                 }
                 LCD.update();
             }
-            wait(0.2);
+            WAIT_S(0.2); 
             LCD.setBlinkMode( LCD_BLINKMODE_INVERSE );
-            wait(0.2); 
+            WAIT_S(0.2); 
             LCD.setBlinkMode( LCD_BLINKMODE_NONE );
-            wait(0.2);     
+            WAIT_S(0.2); 
         }
-        wait(0.5); 
+        WAIT_S(0.5); 
            
         /*  Watch  */
         LCD.background( LCD_COLOR_WHITE); 
@@ -128,7 +134,7 @@
             LCD.locate(72, 54);        
             LCD.printf("%02d",k+20);
             LCD.update();
-            wait((double)exp((double)(-k/3))); // time constant =3
+            WAIT_S((double)exp((double)(-k/3))); // time constant =3            
         }
     }
 }
diff -r 19961b4a7239 -r 25d611652243 mbed-os.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Fri Nov 29 16:46:40 2019 +0000
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#610e35ddc6d59f153173c1e7b2748cf96d6c9bcd
diff -r 19961b4a7239 -r 25d611652243 mbed.bld
--- a/mbed.bld	Thu Jun 23 02:35:10 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/252557024ec3
\ No newline at end of file