390
Single-Channel Capacitive Touch
This is the very first capacitive touch example we will look at. Although a single capacitive touch button
has very little use in real life, it is good for realizing the mechanism behind this capaicitive touch
technology. If this example is well understood then everything related to capacitive touch sensing will
be realized without any confusion or doubt.
Code Example
structure.h (top part only)
#ifndef CTS_STRUCTURE_H_
#define CTS_STRUCTURE_H_
#include "msp430.h"
#include <stdint.h>
/* Public Globals */
// Middle Element on the LaunchPad Capacitive Touch BoosterPack
extern const struct Element middle_element;
// One Button Sensor
extern const struct Sensor one_button;
//****** RAM ALLOCATION ********************************************************
// TOTAL_NUMBER_OF_ELEMENTS represents the total number of elements used, even if
// they are going to be segmented into seperate groups. This defines the
// RAM allocation for the baseline tracking. If only the TI_CAPT_Raw function
// is used, then this definition should be removed to conserve RAM space.