pyupm_at42qt1070 module

class pyupm_at42qt1070.AT42QT1070(bus, address=27)[source]

Bases: object

API for the Atmel AT42QT1070 QTouch Sensor.

ID: at42qt1070

Name: Seven-channel QTouch Touch Sensor

Other Names: Grove QTouch Sensor

Category: touch

Manufacturer: seeed

Connection: i2c

Link:http://wiki.seeed.cc/Grove-Q_Touch_Sensor/ This class implements support for the Atmel AT42QT1070 QTouch sensor, which supports 7 capacitive buttons.

It was developed using a Grove-Q Touch Sensor board.

C++ includes: at42qt1070.hpp

DET_CALIBRATE = 128
DET_OVERFLOW = 64
DET_TOUCH = 1
REG_AVE0 = 39
REG_AVE1 = 40
REG_AVE2 = 41
REG_AVE3 = 42
REG_AVE4 = 43
REG_AVE5 = 44
REG_AVE6 = 45
REG_CALIBRATE = 56
REG_CHIPID = 0
REG_DETSTATUS = 2
REG_DI0 = 46
REG_DI1 = 47
REG_DI2 = 48
REG_DI3 = 49
REG_DI4 = 50
REG_DI5 = 51
REG_DI6 = 52
REG_FWVERS = 1
REG_GUARD = 53
REG_KEYSIG0_H = 4
REG_KEYSIG0_L = 5
REG_KEYSIG1_H = 6
REG_KEYSIG1_L = 7
REG_KEYSIG2_H = 8
REG_KEYSIG2_L = 9
REG_KEYSIG3_H = 10
REG_KEYSIG3_L = 11
REG_KEYSIG4_H = 12
REG_KEYSIG4_L = 13
REG_KEYSIG5_H = 14
REG_KEYSIG5_L = 15
REG_KEYSIG6_H = 16
REG_KEYSIG6_L = 17
REG_KEYSTATUS = 3
REG_LP = 54
REG_MAXON = 55
REG_NTHR0 = 32
REG_NTHR1 = 33
REG_NTHR2 = 34
REG_NTHR3 = 35
REG_NTHR4 = 36
REG_NTHR5 = 37
REG_NTHR6 = 38
REG_REFDATA0_H = 18
REG_REFDATA0_L = 19
REG_REFDATA1_H = 20
REG_REFDATA1_L = 21
REG_REFDATA2_H = 22
REG_REFDATA2_L = 23
REG_REFDATA3_H = 24
REG_REFDATA3_L = 25
REG_REFDATA4_H = 26
REG_REFDATA4_L = 27
REG_REFDATA5_H = 28
REG_REFDATA5_L = 29
REG_REFDATA6_H = 30
REG_REFDATA6_L = 31
REG_RESET = 57
calibrate()[source]

bool calibrate()

Issues a calibrate command

True if successful

getAKSGroup(key)[source]

uint8_t getAKSGroup(uint8_t key)

Reads the AKS group of which a key is part

key: Key (0-6) being queried

AKS group of which the key is part

getAVE(key)[source]

uint8_t getAVE(uint8_t key)

Reads the current averaging factor setting for a key

key: Key being read

Averaging factor

getButtons()[source]

uint8_t getButtons()

Gets the current button states

Button states

getLPMode()[source]

uint8_t getLPMode(void)

Reads the current low-power mode setting

Low-power mode setting from the sensor

isCalibrating()[source]

bool isCalibrating()

Returns the calibrating indicator

True if calibration is in progress

isOverflowed()[source]

bool isOverflowed()

Returns the overflow indicator

True if overflow is indicated

readByte(reg)[source]

uint8_t readByte(uint8_t reg)

Read a byte value from the register

reg: Register location to read from

Value in the specified register

readChipID()[source]

uint8_t readChipID(void)

Reads the Chip ID register on the sensor

Value of the Chip ID register

readWord(reg)[source]

uint16_t readWord(uint8_t reg)

Read a word value from the register. Note: the device must have the auto-increment bit set in the MODE1 register to work.

reg: Register location to read from

Value in the specified register

reset()[source]

bool reset()

Issues a reset command

True if successful

setAKSGroup(key, group)[source]

uint8_t setAKSGroup(uint8_t key, uint8_t group)

Changes the AKS group of which a key is part

key: Key (0-6) being changed

group: New group for the key

New value on the sensor

setAVE(key, ave)[source]

uint8_t setAVE(uint8_t key, uint8_t ave)

Changes the averaging factor setting for a key

key: Key being changed

ave: New averaging factor

New averaging factor as read from the device

setLPMode(mode)[source]

uint8_t setLPMode(uint8_t mode)

Changes the low-pomer mode setting on the sensor

mode: dDsired new mode

New setting on the sensor

updateState()[source]

void updateState()

Reads the current touch status and detection state

Key status bits for all keys (0-6)

writeByte(reg, byte)[source]

bool writeByte(uint8_t reg, uint8_t byte)

Writes a byte value into the register

reg: Register location to write into

byte: Byte to write

True if successful

writeWord(reg, word)[source]

bool writeWord(uint8_t reg, uint16_t word)

Writes a word value into the register. Note: the device must have the auto-increment bit set in the MODE1 register to work.

reg: Register location to write into

word: Word to write

True if successful