the code for Lab3

Fork of ADCandticker_sample by William Marsh

Files at this revision

API Documentation at this revision

Comitter:
toh2018
Date:
Mon Feb 12 13:15:15 2018 +0000
Parent:
4:8edcd6d3c39f
Commit message:
fix the button

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 8edcd6d3c39f -r 3bd67c8bb0ee main.cpp
--- a/main.cpp	Fri Feb 09 21:07:44 2018 +0000
+++ b/main.cpp	Mon Feb 12 13:15:15 2018 +0000
@@ -104,7 +104,7 @@
     led4 = 1;
     led5 = 1;
     int volts = 0 ;
-    //const int threshold = 100 ;
+    //const int threshold;
     const int threshold1 = 55 ;
     const int threshold2 = 110 ;
     const int threshold3 = 165 ;
@@ -112,6 +112,7 @@
     const int threshold5 = 275 ;
     int counter = 0 ;
     char vstring[] = "X.XX\r\n" ;
+    //threshold1 = maxvolt/6;
 
     tick.attach_us(callback(&readA0), 10000); // ticks every 10ms
     while (true) {
@@ -128,6 +129,12 @@
                pressEvent =0;
                maxvolt = volts;
                /// update the threshold here 
+               //threshold1 = maxvolt / 6;
+               led1 = 1;
+                    led2 = 1;
+                    led3 = 1;
+                    led4 = 1;
+                    led5 = 1;
             } 
             
             // End of the pressEvent ////////////////////////////