tim004 tim004 / Mbed 2 deprecated LV4-Grupa6-Zadatak1-Tim004

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
tim004
Date:
Thu Mar 27 17:07:22 2014 +0000
Commit message:
LV4-Grupa6-Zadatak1-Tim004

Changed in this revision

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Mar 27 17:07:22 2014 +0000
@@ -0,0 +1,44 @@
+#include "mbed.h"
+ 
+int brojevi[10]= {0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x078,0x0,0x10};
+BusOut displej(dp26, dp27, dp5, dp6, dp28, dp1, dp2);
+BusOut cifre(dp23, dp24, dp25);
+DigitalOut zarez(dp4);
+AnalogIn ain(dp9);
+DigitalOut enable(dp14);
+ 
+void prikaz(float vrijednost)
+{
+    int prva=0, druga=0, treca=0;
+    prva=int(vrijednost); druga=int((vrijednost-int(vrijednost))*10); treca=((vrijednost-int(vrijednost))*100);
+    treca=treca%10;
+    for(int i=0;i<30;i++){
+
+        displej=brojevi[prva];
+        cifre=6;
+        zarez=0;
+        wait_ms(1);
+        cifre=0;
+        zarez=1;
+        cifre=7;    
+        displej=brojevi[druga];
+        cifre=5;  
+        wait_ms(1);  
+        cifre=0;
+        cifre=7;     
+        displej=brojevi[treca];
+        cifre=3;
+        wait_ms(1);
+        cifre=0;
+    }
+}
+ 
+int main() {  
+    float e=ain;
+    enable=1;
+    while(1) {      
+        for(int i=0; i<5; i++)
+        prikaz(e*3.3);
+        e=ain;
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Mar 27 17:07:22 2014 +0000
@@ -0,0 +1,1 @@
+http://world3.dev.mbed.org/users/mbed_official/code/mbed/builds/824293ae5e43
\ No newline at end of file