A capacitive touch sensor using a analog input port.

Dependencies:   TouchSense mbed

Files at this revision

API Documentation at this revision

Comitter:
shintamainjp
Date:
Wed Aug 14 09:11:26 2013 +0000
Commit message:
The first version of the sample.

Changed in this revision

TouchSense.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 56ef498b597d TouchSense.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TouchSense.lib	Wed Aug 14 09:11:26 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/shintamainjp/code/TouchSense/#5a0704efe081
diff -r 000000000000 -r 56ef498b597d main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Aug 14 09:11:26 2013 +0000
@@ -0,0 +1,43 @@
+/* mbed Microcontroller Sample Program
+ * Copyright (c) 2013 Shinichiro Nakamura
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "mbed.h"
+#include "TouchSense.h"
+ 
+TouchSense ts1(p15);
+TouchSense ts2(p16);
+TouchSense ts3(p17);
+TouchSense ts4(p18);
+TouchSense ts5(p19);
+TouchSense ts6(p20);
+ 
+int main() {
+    ts1.calibration();
+    ts2.calibration();
+    ts3.calibration();
+    ts4.calibration();
+    ts5.calibration();
+    ts6.calibration();
+    while (true) {
+        printf("[%c%c%c%c%c%c]\r\n",
+            ts1.sense() ? 'o' : '.',
+            ts2.sense() ? 'o' : '.',
+            ts3.sense() ? 'o' : '.',
+            ts4.sense() ? 'o' : '.',
+            ts5.sense() ? 'o' : '.',
+            ts6.sense() ? 'o' : '.');
+        wait(0.050);
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 56ef498b597d mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Aug 14 09:11:26 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/5798e58a58b1
\ No newline at end of file