1.44 tft lcd display

Dependencies:   TFT_fonts mbed-os

Fork of newTFTLCD by madhu sudhana

Revision:
28:6ac2fa56f82c
Child:
29:35482446e4ee
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu May 24 07:55:36 2018 +0000
@@ -0,0 +1,92 @@
+ #include "mbed.h"
+ #include "st7735.h"
+ #include "lcd_base.h"
+  //#include "ili9328.h"
+ 
+ #if   defined (TARGET_KL25Z) || defined (TARGET_KL46Z)
+  PinName const p14 = PTE3;
+  PinName const p13 = PTE4;
+  PinName const p12 = PTB0;
+  PinName const p11 = PTE2;
+  PinName const p10 = PTE1;
+#else
+  #error TARGET NOT DEFINED
+#endif
+void ratation(int x);
+
+  // LCD  hellow( NC ,NC,p14, p12, p13);
+  
+  // create the lcd instance
+  ST7735_LCD lcd( p14, p13, p12, p11, p10 ); // control pins
+ 
+  int main()
+  {  
+   while(1){
+lcd.Initialize();//Display initialization
+lcd.FillRect( 0, 0, 128, 128 );//fills the screen with zero "function does screen clearing
+lcd.DrawRect( 1, 1,128, 128);//co-ordinates(x1,y1,x2,y2)
+//lcd.SetFont(); //function has to modify
+ratation(0);//text withought any rotation and here we can write any text with no rotation and with colour but there is limit to display character 
+wait_ms( 5250 );//delay 5.250sec
+lcd.FillRect( 0, 0, 128, 128 );//again clear screen
+ratation(-1);//text invertion
+wait_ms( 5250 );//again delay
+lcd.FillRect( 0, 0, 128, 128 );//lear screen
+wait_ms( 5250 );
+lcd.DrawRoundRect( 25, 25, 100, 100);//colours can be changed from function in lcd_base.h file
+ wait_ms( 1250 );
+lcd.FillRect( 0, 0, 128, 128 );
+lcd.DrawLine( 0,0, 128, 128);
+wait_ms( 5250 );
+lcd.FillRect( 0, 0, 128, 128 );
+    //lcd.Sleep( );
+lcd.DrawCircle( 64, 64, 50);
+wait_ms( 5250 );
+lcd.FillRect( 0, 0, 128, 128 );
+lcd.FillCircle( 64, 64, 60,COLOR_RED );
+wait_ms( 5250 );  
+lcd.FillCircle( 64, 64, 50,COLOR_GREEN );
+lcd.FillCircle( 64, 64, 20,COLOR_YELLOW );
+wait_ms( 5250 ); 
+wait_ms( 5250 ); 
+     }
+   
+  }
+ 
+ 
+ void ratation(int x)
+ {   
+    if (x==90)
+    { lcd.Print( "READINGS ARE", 5, 5 );//vallue of deg in print function in lcd_base.h file be 0
+      lcd.Print( "B SUGAR=80mg/dl", 2, 90);
+      lcd.Print( "ECG=75", 30, 30);
+      lcd.Print( "BP=120/80", 30,60); 
+      }
+     
+      else if(x==180)
+      {
+      lcd.Printinv( "  READINGS ARE", 123, 110 );//vallue of deg in printinv function in lcd_base.h file be 180
+       lcd.Printinv( "BP=120/80", 123,15);
+      lcd.Printinv( "ECG=75", 123, 40);
+      lcd.Printinv( "B SUGAR=80mg/dl", 126, 75);
+      }
+      else if(x==-1)
+      {
+      lcd.Printinv( "  READINGS ARE", 120, 5);//vallue of deg in printinv function in lcd_base.h file be 90
+       lcd.Printinv( "BP=120/80", 95,15);
+      lcd.Printinv( "ECG=75", 70,15);
+      lcd.Printinv( "B SUGAR=80mg/dl", 40,5);
+      }
+     
+     else if (x==0)
+    { 
+      lcd.Print( "READINGS ARE", 25, 110 );//vallue of deg in print function in lcd_base.h file be 270
+      lcd.Print( "B SUGAR=80mg/dl", 110, 120);
+      lcd.Print( "ECG=75", 85, 100);
+      lcd.Print( "BP=120/80", 60,100); 
+      }
+      else
+      {
+          lcd.Print( "ERROR", 0,0 );
+    }
+    }      
\ No newline at end of file