Simple Hello World example demonstrating the QT2100 library. The example initializes, configures, and acquires touch sensor data from a AT42QT2100 device. Output is displayed to a serial terminal for demonstration purposes--data can be used to control a system.
Diff: main.cpp
- Revision:
- 0:bf4b6e255868
diff -r 000000000000 -r bf4b6e255868 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Jan 13 00:22:17 2015 +0000
@@ -0,0 +1,22 @@
+
+#include "mbed.h"
+#include "QT2100.h"
+
+Serial pc(USBTX, USBRX);
+
+QT2100 qtouch(p5, p6, p7, p8, USBTX, USBRX);
+
+main(void)
+{
+ qtouch.init();
+ qtouch.devId();
+ qtouch.verifyChannels();
+
+ while(1) {
+
+ pc.printf(" QT2100 Controller: Button: %d Slider Value: %x\n",
+ qtouch.keys(), qtouch.slider());
+
+ wait_ms(50);
+ }
+}
Atmel AT42QT2100 Capacitive Touch Controller