Determine input capacity on digital input using internal pull up/down.

Files at this revision

API Documentation at this revision

Comitter:
hornfeldt
Date:
Sat Oct 02 22:03:01 2010 +0000
Commit message:

Changed in this revision

libcap.cpp Show annotated file Show diff for this revision Revisions of this file
libcap.h Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libcap.cpp	Sat Oct 02 22:03:01 2010 +0000
@@ -0,0 +1,6 @@
+#ifndef LIBCAP_H
+#define LIBCAP_H
+
+#include "libcap.h"
+
+#endif /* LIBCAP_H */
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libcap.h	Sat Oct 02 22:03:01 2010 +0000
@@ -0,0 +1,32 @@
+#ifndef LIBCAP_H
+#define LIBCAP_H
+
+#include "mbed.h"
+
+class CapIn
+{
+public:
+    /**
+     * Constructor.
+     *
+     * Creates a object for capacitive measurement on digital pin using default timer.
+     *
+     * @param pin - Digital input pin
+     */
+    CapIn(PinName pin);
+    /**
+     * Constructor.
+     *
+     * Creates a object for capacitive measurement on digital pin using custom timer.
+     *
+     * @param pin - Digital input pin
+     * @param timer - Timer[0-4] uesed for measurement
+      */
+    CapIn(PinName pin, int timer);
+    int read_uF();
+    int read_t();
+private:
+    DigitalIn _pin;
+};
+
+#endif /* LIBCAP_H */
\ No newline at end of file