调用完这个函数后,可以通过查询sensor_states数组(其元素为unsigned char类型)来获取各感应器当前的状态。对于滑轮和滑条,则需查询数组rotor_slider_values。sensor_states位于结构体qt_touch_status_t里,而qt_touch_status_t则位于另一个结构体qt_touch_lib_measure_data_t当中。并且,qt_touch_lib_measure_data_t不需要我们去定义,touch_api.h已经帮我们做好了这个工作了。touch_api.h里有这样的语句
typedef struct tag_qt_touch_lib_measure_data_t
{
/* measured signal on each channel */
uint16_t channel_signals[QT_NUM_CHANNELS];
/* reference signal for each channel */
uint16_t channel_references[QT_NUM_CHANNELS];
/* state of sensors */
qt_touch_status_t qt_touch_status;
} qt_touch_lib_measure_data_t;
……
extern qt_touch_lib_measure_data_t qt_measure_data;
../main.c:15: warning: 'SIG_OVERFLOW1' appears to be a misspelled signal handler
avr-gcc -mmcu=atmega88pa -Wl,-Map=qtouch10.map main.o -L"C:\Program Files\atmel\Atmel_QTouch_Libraries_4.3\Generic_QTouch_Libraries\AVR_Tiny_Mega_XMega\QTouch\library_files" -lavr4g1-8qt-k-2rs -o qtouch10.elf
C:\Program Files\atmel\Atmel_QTouch_Libraries_4.3\Generic_QTouch_Libraries\AVR_Tiny_Mega_XMega\QTouch\library_files\libavr4g1-8qt-k-2rs.a(burst_0_1_00_0.o): In function `burst_0_1_00_0':
burst_0_1_00_0.c:(.text+0x28): undefined reference to `_0111010111_'
burst_0_1_00_0.c:(.text+0x54): undefined reference to `_01001010111_'
burst_0_1_00_0.c:(.text+0xf6): undefined reference to `_0101110111_'
make: *** [qtouch10.elf] Error 1
Build failed with 3 errors and 1 warnings...
AVR studio 4.18 sp3.
Qtouch Lib 4.3
winAVR 20100110