Lab 3 Part 2.4

Fork of Lab3_2 by Divya Vadivel

Files at this revision

API Documentation at this revision

Comitter:
diviavad
Date:
Fri Feb 09 23:57:21 2018 +0000
Parent:
3:b20239a6bd91
Commit message:
Version 1

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r b20239a6bd91 -r 80644a19c35c main.cpp
--- a/main.cpp	Fri Feb 09 23:42:36 2018 +0000
+++ b/main.cpp	Fri Feb 09 23:57:21 2018 +0000
@@ -97,7 +97,6 @@
 //   Attach ISR for ticker
 //   Procss messages from mailbox    
 int main() {
-    bool change_detect = false;
     bool max_volt = false;
     pollT.start(callback(polling));//start thread to check button
     int volts = 0 ;
@@ -111,7 +110,6 @@
         {
             pressEvent=0;
             max_volt = !max_volt;
-            change_detect=false;
             }
         osEvent evt = mailbox.get(); // wait for mail 
         if (evt.status == osEventMail) {
@@ -119,42 +117,42 @@
             volts = (mess->analog * 330) / 0xffff ;
             mailbox.free(mess) ;  // free the message space
       
-            if(volts <=(threshold[0]) and max_volt=false){
+            if((volts <= threshold[0]) and max_volt==false){
                 ledy = 0;
                 ledb = 0;
                 ledr = 0;
                 ledw = 0;
                 ledg = 0;    
                 }
-            else if(volts >=(threshold[0])&&volts <=(threshold[1] and max_volt=false)){//1.1 && volts < 1.65){
+            else if(volts >=(threshold[0])&&volts <=(threshold[1] and max_volt==false)){//1.1 && volts < 1.65){
                 ledy = 1;
                 ledb = 0;
                 ledr = 0;
                 ledw = 0;
                 ledg = 0;   
                 }
-            else if(volts >=(threshold[1])&&volts <=(threshold[2] && max_volt=false)){
+            else if(volts >=(threshold[1])&&volts <=(threshold[2] && max_volt==false)){
                 ledy = 1;
                 ledb = 1;
                 ledr = 0;
                 ledw = 0;
                 ledg = 0;  
                 }
-            else if(volts >=(threshold[2])&&volts <=(threshold[3]) and max_volt=false){
+            else if(volts >=(threshold[2])&&volts <=(threshold[3]) and max_volt==false){
                 ledy = 1;
                 ledb = 1;
                 ledr = 1;
                 ledw = 0;
                 ledg = 0; 
                 }
-            else if(volts >=(threshold[3])&&volts <=(threshold[4]) and max_volt=false){
+            else if(volts >=(threshold[3])&&volts <=(threshold[4]) and max_volt==false){
                 ledy = 1;
                 ledb = 1;
                 ledr = 1;
                 ledw = 1;
                 ledg = 0;  
                 }   
-            else if(volts >=(threshold[4])&&volts <=(threshold[5]) and max_volt=true){
+            else if(volts >=(threshold[4])&&volts <=(threshold[5]) and max_volt==true){
                 ledy = 1;
                 ledb = 1;
                 ledr = 1;