Lab 1.2 digital

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
ParinyaT
Date:
Tue Oct 27 15:47:08 2015 +0000
Parent:
0:7a1ec9e6d1e3
Commit message:
Lab 1.2 digital;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 7a1ec9e6d1e3 -r 562e77e5f6ea main.cpp
--- a/main.cpp	Wed Oct 21 10:14:59 2015 +0000
+++ b/main.cpp	Tue Oct 27 15:47:08 2015 +0000
@@ -2,23 +2,28 @@
 
 AnalogIn analog_val(A1);
 
-BusOut Segment(D3,D4,D5,D6,D7,D8,D9,D10);
-    
+BusOut Segment_1(D3,D4,D5,D6);
+BusOut Segment_2(D7,D8,D9,D10);   
 
 int main() 
 {
     
     float measure;
-    int send;
+    int send,send_1,send_2;
     
     while(1)
     {
         measure = analog_val.read();
         measure = measure * 33;
         send = measure;
+        send_1 = send % 10;
+        send_2 = send / 10;
         
-        Segment = send;
-        wait (25);
+        
+        Segment_1 = send_1;
+        Segment_2 = send_2;
+         
+        wait_us (100);
         
     }
 }