Texas Instruments 430BOOST-SENSE1 Benutzerhandbuch

Seite von 26
LaunchPad Capacitive Touch BoosterPack User Experience Firmware
3.
API Calls
There are five API functions that are called several times in the application.
The TI_CAPT_Init_Baseline and TI_CAPT_Update_Baseline functions initialize and update,
respectively, the baseline tracking performed by the library. Typically, these functions are called at
the beginning of an application or after long periods of inactivity. In this application, the initialization
and updates are performed after a power-up sequence and before a transition from the sleep
(polling proximity sensor only) to active (polling button and wheel only). These functions are used at
the transitions, because it is unknown how old the previous measurements are and if these still
represent the current environment.
The TI_CAPT_Custom function measures the proximity sensor. The variable dCnt is updated with
the measured value. In this application, this variable is compared to a threshold value. Because this
is a simple On/Off function, the TI_CAPT_Button function could have been used but, for
demonstration purposes, the TI_CAPT_Custom function was chosen. When a threshold crossing is
detected, an LED sequence is started, and the application transitions to the active state (polling the
wheel and middle button). One possible enhancement of the proximity sensor application is to
enable several different thresholds and indicate how close the user is with the LEDs on the
BoosterPack.
The TI_CAPT_Button function determines if the middle button has been detected. This function
returns either a 1 to indicate a threshold crossing (touch) or a 0 to indicate that no touch was
detected. The middle LED is illuminated to indicate a touch.
The TI_CAPT_Wheel function indicates the position on the wheel if it was touched or returns a
defined value if no touch was detected. This information is used by the application for gesture
recognition (which is sent to the PC) and for illuminating the eight LEDs around the board.
For more information on the library, see the Capacitive Touch Sense Library User's Guide (
19
SLAU337A
April 2011
Revised September 2011
430BOOST-SENSE1 - Capacitive Touch BoosterPack for the LaunchPad
Copyright
©
2011, Texas Instruments Incorporated