Divya Vadivel
/
Lab3_2
Lab 3 Part 2.2
Fork of ADCandticker_sample by
Diff: main.cpp
- Revision:
- 4:d9666f1c135b
- Parent:
- 3:b20239a6bd91
--- a/main.cpp Fri Feb 09 23:42:36 2018 +0000 +++ b/main.cpp Fri Feb 09 23:58:31 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;