Touch | lrf.touch

The Little Robot Friends have 3 capacitive touch sensors on their face board: the hair sensor, the left hand sensor and the right hand sensor. Please note that the left and right orientation is from the perspective of the robot. Each sensor is capable of sensing 3 types of interactions, the first being a "tap" which is a single touch on the sensor pad. The second type of interaction is a "tickle", this is multiple touches in quick succession

Functions called from within the "touch" portion of the library have the prefix of lrf.touch

enable()

Description

This function enables the touch sensors and the subsequent events they trigger.

Examples

    lrf.touch.enable();

Syntax

    enable()

Parameters

none

Returns

none

Notes

none


disable()

Description

This function disables the touch sensors and the subsequent events they trigger

Examples

    lrf.touch.disable();

Syntax

    disable()

Parameters

none

Returns

none

Notes

none


readHair()

Description

This function returns the raw sensor value for the capacitive touch sensor positioned at the top of the robot's face. It returns true if the sensor is currently touched and false if not.

Examples

    lrf.touch.readHair();

Syntax

    readHair()

Parameters

none

Returns

bool

Notes

none


readLeft()

Description

This function returns the raw sensor value for the capacitive touch sensor positioned on the robot's left side. It returns true if the sensor is currently touched and false if not.

Examples

    lrf.touch.readLeft();

Syntax

    readLeft()

Parameters

none

Returns

int8_t

Notes

The position is from the robot's perspective, the robot's left side, from your perspective, is the right side.


readRight()

Description

This function returns the raw sensor value for the capacitive touch sensor positioned on the robot's right side. It returns true if the sensor is currently touched and false if not.

Examples

    lrf.touch.readRight();

Syntax

    readRight()

Parameters

none

Returns

int8_t

Notes

The position is from the robot's perspective, the robot's left side, from your perspective, is the right side.