Renewal Sample code, SpeedMeter Demo with MIP8F_SPI_Ver50

Dependencies:   mbed MIP8F_SPI_Ver50

Introduction

Renewal Version. Number charactors count up sample like a speed meter of a car with MIP8F_SPI_Ver50

Only for LPM027M128x (400x240) ,JDI DIsplay.

Other information , please refer to https://os.mbed.com/teams/JapanDisplayInc/code/MIP8f_FRDM_sample/

Usage

Copy Setting File and Image to micro SD-CARD. you can NOT use same sample color images of OTHER VERSION SAMPLE.

a) Download the following file corresponding to the target panel, and rename file identifier (.bin -> .zip), and unzip the file on micro SD Card's root directory.

LPM027M128x (400x240) :/media/uploads/JDI_Mbed_Team/speedmeter2-400x240.bin

\SpeedMeter2-400x240 (SD card) (X:)

 |-settings2.txt

 |-SpeedMeter2-400x240

     |- n00021 400x240 navi_mod2.bmp

b) Insert micro SD-CARD to FRDM-K64F. c) Upload binary file to FRDM-K64F.and push Reset Button.

Other information

refer to Usage on https://os.mbed.com/teams/JapanDisplayInc/code/MIP8f_FRDM_sample/

this Sample Code (.bin)

/media/uploads/JDI_Mbed_Team/mip8f_frdm_countupnumber_sample2.k64f.bin

This sample Video

Files at this revision

API Documentation at this revision

Comitter:
JDI_Mbed_Team
Date:
Mon Nov 19 04:45:11 2018 +0000
Parent:
9:0550432c22b5
Commit message:
renewal sample code, SpeedMeter demo

Changed in this revision

MIP8F_SPI.lib Show diff for this revision Revisions of this file
MIP8F_SPI_Ver50.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
diff -r 0550432c22b5 -r 733bfa7cf111 MIP8F_SPI.lib
--- a/MIP8F_SPI.lib	Wed Oct 31 02:18:53 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-https://os.mbed.com/teams/JapanDisplayInc/code/MIP8F_SPI_Ver30/#944f2968c19f
diff -r 0550432c22b5 -r 733bfa7cf111 MIP8F_SPI_Ver50.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MIP8F_SPI_Ver50.lib	Mon Nov 19 04:45:11 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/teams/JapanDisplayInc/code/MIP8F_SPI_Ver50/#8cc8e00fed46
diff -r 0550432c22b5 -r 733bfa7cf111 main.cpp
--- a/main.cpp	Wed Oct 31 02:18:53 2018 +0000
+++ b/main.cpp	Mon Nov 19 04:45:11 2018 +0000
@@ -1,6 +1,6 @@
 /**
 * @file main.cpp
-* @brief Ver3.0 Sample source code for MIP8 diplay. 
+* @brief Ver6.0 Sample source code for MIP8 diplay. 
 * @details  
 *
 * Ver3.0 Addtional function is font display. this demo code is tha degit is counted up like a meter panel
@@ -106,7 +106,7 @@
         fscanf(fp, "%d",&width);     //width read
         fscanf(fp, "%d",&height);    //height read
         fscanf(fp, "%d",&blctrl_sel);//blct_sel read //0:40mA, 1:160mA
-        sprintf(filepath,"/sd/%dx%d",width,height); //DispAllDir("/sd/180x180")    //file name write to filepath
+        sprintf(filepath,"/sd/SpeedMeter2-%dx%d",width,height); //DispAllDir("/sd/180x180")    //file name write to filepath
         fclose(fp);  
     } else {
         FILE *fp = fopen("/sd/settings.txt", "rb");    //read binary
@@ -149,15 +149,14 @@
 
     //DIR *d;
 
+    filenum = CntFile(filepath);    //file number read
+	ReadBmp(filepath,0);
    	while(1)
     { //BITMAPS
-        filenum = CntFile(filepath);    //file number read
 	   	for(uint32_t i=0; i<filenum; i++)
         {
 	        for( int j = 0; j < 2; j++)
        		{
-				ReadBmp(filepath,0);
-
   	       		 while(HaltSW.State()) {             // VCOM invert when image is still
 	       	    //    pol++;
     	       	//    WD.command( (pol << 6) & 0x40 ); 
@@ -166,12 +165,21 @@
            		HaltSW.Clear();
 
 				//1bit trasfer mode = monochro diplay
-				if( j%2 == 0  && bmp_bitcount != 8)
-					WD.writeDISP(TrBIT4);
-				else			
-					WD.writeDISP(TrBIT1);
+				//if( j%2 == 0  && bmp_bitcount != 8)
+					WD.writeDISP(TrBIT3);
+				//else			
+				//	WD.writeDISP(TrBIT1);
 		        //wait(2);
 
+
+				sprintf(KMPH,"km/h");
+				WD.set_ActualFontWidth();
+				WD.set_font((unsigned char*) Arial28x28); 
+		        WD.foreground(0x0e);
+		        WD.background(0x00);
+				WD.obliqueout(290,200,KMPH);
+
+
 				if( j%2 == 0 )
 				{
 					// for color diaplay
@@ -183,26 +191,20 @@
 			        WD.background(0x00);
 				}
 				//WD.fillrect(0,115,399,205, WD.get_Background() );
-
-				sprintf(KMPH,"km/h");
-				WD.set_ActualFontWidth();
-				WD.set_font((unsigned char*) Arial28x28); 
-				WD.obliqueout(70+200+35,100+20+49,KMPH);
-
 	        	WD.set_font((unsigned char*) Arial94x94); 
 				WD.set_FixedFontWidth(50);
 				for(int t=0;t<100;t++)
 				{
 					sprintf(countup,"%2d",t);
-					WD.obliqueout(70+35+48,100+20,countup);
+					WD.obliqueout(130,150,countup);
 
 					//1bit trasfer mode = monochro diplay
 					if( j%2 == 0  /*&& bmp_bitcount != 8*/)
 						// for color display
-						WD.writeDISP(100+20,190+20,TrBIT4);
+						WD.writeDISP(150,225,TrBIT3);
 					else
 						// for color diaplay
-						WD.writeDISP(100+20,190+20,TrBIT1);
+						WD.writeDISP(150,225,TrBIT1);
 
 					if( j%2 == 0 && t==60)
 					{