This program varies the voltage coming from the AnalogOut pin (PTE30) on the FRDM-KL25Z according to the reading from the capacitive touch slider.

Dependencies:   mbed tsi_sensor

Files at this revision

API Documentation at this revision

Comitter:
sarahboydster
Date:
Mon May 26 00:22:43 2014 +0000
Commit message:
First version.

Changed in this revision

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
tsi_sensor.lib Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r b6d19a9ddd81 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon May 26 00:22:43 2014 +0000
@@ -0,0 +1,19 @@
+#include "mbed.h"
+#include "tsi_sensor.h"
+
+#define ELEC0 9
+#define ELEC1 10
+
+
+AnalogOut analogOut(PTE30);
+
+int main(void) {
+    PwmOut led(LED_GREEN);
+    TSIAnalogSlider tsi(ELEC0, ELEC1, 40);
+    
+    while (true) {
+        led = 1.0 - tsi.readPercentage();
+        analogOut = tsi.readPercentage();
+        wait(0.1);
+    }
+}
diff -r 000000000000 -r b6d19a9ddd81 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon May 26 00:22:43 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/0b3ab51c8877
\ No newline at end of file
diff -r 000000000000 -r b6d19a9ddd81 tsi_sensor.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsi_sensor.lib	Mon May 26 00:22:43 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/Kojto/code/tsi_sensor/#20ffa9b18488