noop din
/
ADCandticker_sample
the code for Lab3
Fork of ADCandticker_sample by
Diff: main.cpp
- Revision:
- 3:2db0cd79282b
- Parent:
- 2:f7c24790b1ad
- Child:
- 4:8edcd6d3c39f
--- a/main.cpp Fri Feb 09 20:57:12 2018 +0000 +++ b/main.cpp Fri Feb 09 21:03:44 2018 +0000 @@ -20,7 +20,7 @@ volatile int pressEvent = 0 ; // Variabe set by the polling thread volatile int maxvolt = 330; -/// implement the botton +/// implement the botton here ///////////////////////////////////// enum buttonPos { up, down, bounce }; // Button positions @@ -54,7 +54,7 @@ Thread::wait(30); } } - // end the button + // end the button ////////////////////////////////////////////////// // Message type typedef struct { @@ -104,7 +104,7 @@ led4 = 1; led5 = 1; int volts = 0 ; - const int threshold = 100 ; + //const int threshold = 100 ; const int threshold1 = 55 ; const int threshold2 = 110 ; const int threshold3 = 165 ; @@ -121,17 +121,16 @@ volts = (mess->analog * 330) / 0xffff ; mailbox.free(mess) ; // free the message space - //press event + ////press event //////////////////////////////////// if(pressEvent) { pressEvent =0; maxvolt = volts; - //threshold= maxvolt / 6; + } - - // End of the pressEvent + // End of the pressEvent //////////////////////////// if (volts > threshold1) led1 = 1 ; else led1 = 0 ; if (volts > threshold2) led2 = 1 ; else led2 = 0 ;