Example program to control the brightness of an LED using the touch sensor interface

Dependencies:   TSI mbed

Dependents:   FRDM-KL46Z_LCD_Test FRDM-KL46Z_LCD_Test FRDM-KL46Z_I2C-Scanner

Legacy Warning

This is an mbed 2 example. To learn more about mbed OS 5, visit the docs.

Files at this revision

API Documentation at this revision

Comitter:
emilmont
Date:
Thu Oct 11 11:05:51 2012 +0000
Child:
1:51b1b688179a
Commit message:
KL25Z TSI example

Changed in this revision

TSI.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-KL25Z.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TSI.lib	Thu Oct 11 11:05:51 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/emilmont/code/TSI/#afbd8e2c8bc0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Oct 11 11:05:51 2012 +0000
@@ -0,0 +1,14 @@
+#include "mbed.h"
+#include "TSI_Sensor.h"
+
+int main(void) {
+    DigitalOut led(LED_GREEN);
+    TSI_Sensor tsi;
+    
+    while (true) {
+        printf("slider percentage: %d%\r\n", tsi.getPercentage());
+        printf("slider distance: %dmm\r\n", tsi.getDistance());
+        wait(1);
+        led = !led;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-KL25Z.lib	Thu Oct 11 11:05:51 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/emilmont/code/mbed-KL25Z/#2fd6de8f897c