Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: touch1.cpp
- Revision:
- 0:cdbd21489e81
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/touch1.cpp Tue Nov 30 22:03:27 2010 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+
+#define numsamples 1
+
+AnalogIn input1(p15);
+DigitalIn charger1(p16);
+DigitalOut ground1(p17);
+
+int touchSense1(void) {
+ float sample;
+ ground1 = 0;
+ charger1.mode(PullUp);
+ charger1.mode(PullNone);
+ sample=input1.read();
+ if (sample < 0.3) {
+ return 1;
+ } else {
+ return 0;
+ }
+}