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.

main.cpp

Committer:
armed
Date:
2015-01-13
Revision:
0:bf4b6e255868

File content as of revision 0:bf4b6e255868:


#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);
    }
}