Andriy Makukha / Mbed 2 deprecated football_project_wo_output

Dependencies:   mbed

Fork of football_project by MZJ

Revision:
26:40a0c775ff27
Parent:
25:99f1399d40b3
Child:
29:ae208b014987
Child:
30:c60b0d52b067
--- a/TA.cpp	Tue Dec 15 12:11:05 2015 +0000
+++ b/TA.cpp	Wed Dec 30 14:00:28 2015 +0000
@@ -121,7 +121,9 @@
 DigitalOut TA::enable_3(p8);
 #endif
 
-//DigitalOut TA::cap_enable(p1);
+DigitalOut TA::cap_enable(p2);
+DigitalIn  touch_top(p1);
+DigitalIn  touch(p12);
 
 DigitalOut TA::buzzPin(p20);
 
@@ -278,12 +280,21 @@
   static unsigned long random_wait_start = 0;
   static unsigned long mem_monitor_start = 0;
 
+  static unsigned long last_touch = 0;
+  
+  if (last_touch == 0 || millis()-last_touch > 3000)
+  {
+        writeToPhone("Touch value: %d\r\n", touch_top);
+        last_touch = millis();  
+    }
+
   if(tripped())
   {
-    //cap_enable = 1;
-    //wait_ms(100);
-    //cap_enable = 0;
+    cap_enable = 1;
+    wait_ms(100);
+    cap_enable = 0;
     //activated_start = millis();
+    writeToPhone("toggled cap sense power");
     //Serial.println(F("toggled cap sense power"));
     }
   if(powering_up2)
@@ -485,7 +496,7 @@
   //buttons |= touch_1?1:0;
   //buttons |= touch_2?2:0;
   //buttons |= touch_3?4:0;
-  return buttons;
+  return touch;
 
 }