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: touch0.cpp
- Revision:
- 0:cdbd21489e81
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/touch0.cpp Tue Nov 30 22:03:27 2010 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+
+#define numsamples 1
+
+AnalogIn input(p20);
+DigitalIn charger(p19);
+DigitalOut ground(p18);
+
+int touchSense0(void) {
+ float sample;
+ ground = 0;
+ charger.mode(PullUp);
+ charger.mode(PullNone);
+ sample=input.read();
+ if (sample < 0.3) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
\ No newline at end of file