Drugi zadatak, LV3.

Dependencies:   SPI_TFT_ILI9341 TFT_fonts mbed

Files at this revision

API Documentation at this revision

Comitter:
2016US_LejlaDzanko
Date:
Fri Mar 18 16:33:40 2016 +0000
Commit message:
Drugi zadatak u LV 3

Changed in this revision

SPI_TFT_ILI9341.lib Show annotated file Show diff for this revision Revisions of this file
TFT_fonts.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 87eb331325ff SPI_TFT_ILI9341.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SPI_TFT_ILI9341.lib	Fri Mar 18 16:33:40 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/dreschpe/code/SPI_TFT_ILI9341/#b2b3e5430f81
diff -r 000000000000 -r 87eb331325ff TFT_fonts.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TFT_fonts.lib	Fri Mar 18 16:33:40 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/dreschpe/code/TFT_fonts/#76774250fcec
diff -r 000000000000 -r 87eb331325ff main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Mar 18 16:33:40 2016 +0000
@@ -0,0 +1,84 @@
+#include "mbed.h"
+#define dp23 P0_0
+
+
+#include "stdio.h"
+#include "SPI_TFT_ILI9341.h"
+#include "string"
+#include "Arial12x12.h"
+#include "Arial24x23.h"
+#include "Arial28x28.h"
+#include "font_big.h"
+
+
+SPI_TFT_ILI9341 TFT(dp2,dp1,dp6,dp24,dp23,dp25,"TFT"); // mosi, miso, sclk, cs, reset, dc
+AnalogIn napon(dp9);
+
+int main() {
+    
+    float ocitavanje;
+    float temperatura;
+    int hor = 20;
+    int ver = 170 - 1833*( napon-0.06);
+    int vrijeme = 0;
+    
+    TFT.claim(stdout);
+    TFT.set_orientation(1);
+    TFT.background(White);     
+    TFT.foreground(Black);    
+    TFT.cls();                
+    
+    TFT.line(20, 170, 230, 170, Black); //x-osa
+    TFT.line (25, 175, 25, 50, Black); //y-osa
+    
+    while(1) {
+
+        ocitavanje = napon;
+        if (ocitavanje*330<temperatura)
+        koeficijent = 1;
+        else 
+        koeficijent = -1;
+        
+        temperatura = ocitavanje * 330;
+        
+        //240x320
+        
+        
+        TFT.set_font((unsigned char*) Arial12x12);
+        
+        TFT.locate(160,10);
+        printf("Napon: %f mV",ocitavanje*3300);
+        
+        TFT.locate(160,38);
+        printf("Temp: %f C",ocitavanje*330);
+        
+        TFT.locate(160,66);
+        printf("Vrijeme %d:",vrijeme);
+        
+        if (hor==170) break;
+         
+         
+        TFT.line(hor, ver, hor + 10, (170 - 1833*( ocitavanje-0.06)), Red); 
+        
+        TFT.fillcircle(hor+10,170 - 1833*( ocitavanje-0.06),4,Black);
+        
+        hor = hor + 10;
+        
+        ver = 170 - 1833*( ocitavanje-0.06);
+        
+        wait_ms(950);
+        
+        vrijeme++;
+        
+      
+    }
+}
+
+
+
+
+
+
+
+
+
diff -r 000000000000 -r 87eb331325ff mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Mar 18 16:33:40 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/87f2f5183dfb
\ No newline at end of file