task411complete

Fork of Task411-FZ429 by University of Plymouth - Stages 1, 2 and 3

Files at this revision

API Documentation at this revision

Comitter:
martinjamesallen1991
Date:
Sat Mar 10 02:26:20 2018 +0000
Parent:
1:d34891c6377e
Commit message:
added led

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r d34891c6377e -r 6cf019cb87f5 main.cpp
--- a/main.cpp	Thu Jul 13 14:52:05 2017 +0000
+++ b/main.cpp	Sat Mar 10 02:26:20 2018 +0000
@@ -1,8 +1,10 @@
 #include "mbed.h"
 
+
 //Global objects
-BusOut binaryOutput(D5, D6, D7);    //Outputs as an integer
-
+DigitalOut Redled (D7);
+DigitalOut Amberled (D6);
+DigitalOut Greenled (D5);
 DigitalIn SW1(D3);
 DigitalIn SW2(D4);
 
@@ -15,6 +17,17 @@
 
     while(1) {
         
+        if (fVin >= 0.5f) 
+{
+    Redled = 1;
+    Greenled = 0;
+}
+else
+{
+    Redled = 0;
+    Greenled = 1; 
+}
+        
         //Read ADC         
         fVin = AIN;