test demo

Dependencies:   mbed tsi_sensor

Files at this revision

API Documentation at this revision

Comitter:
hww3
Date:
Sat May 24 23:10:38 2014 +0000
Commit message:
start

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 78f66c2d8382 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat May 24 23:10:38 2014 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+#include "tsi_sensor.h"
+
+/* This defines will be replaced by PinNames soon */
+#if defined (TARGET_KL25Z) || defined (TARGET_KL46Z)
+  #define ELEC0 9
+  #define ELEC1 10
+#elif defined (TARGET_KL05Z)
+  #define ELEC0 9
+  #define ELEC1 8
+#else
+  #error TARGET NOT DEFINED
+#endif
+
+int main(void) {
+    PwmOut led(LED_GREEN);
+    TSIAnalogSlider tsi(ELEC0, ELEC1, 40);
+    
+    while (true) {
+        led = 1.0 - tsi.readPercentage();
+        wait(0.1);
+    }
+}
diff -r 000000000000 -r 78f66c2d8382 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat May 24 23:10:38 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 78f66c2d8382 tsi_sensor.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsi_sensor.lib	Sat May 24 23:10:38 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/Kojto/code/tsi_sensor/#20ffa9b18488