touch_calibrate()

Description

Usually the TouchShield is factory programmed with an optimal touchscreen calibration. If you need to update the calibration for any reason, you can use the following routine.

When this function is called, it will reset the previous calibration and prompt the user for a new calibration. Typically touch_calibrate() is called once during setup.

The calibration routine will prompt you to touch a series of red dots. Try to accurately touch the center of the dot using your finger. A more accurate calibration can be achieved using the back side of a plastic pen, or stylus.

The calibration parameters are stored into EEPROM. Please upload new code once this function completes.

Syntax


touch_calibrate();


Example

void setup() {
touch_calibrate();

background(0);
text(“Calibration complete.”, 0, 0);
text(“Please upload new code.”, 0, 10);
}

void loop() {
//just loop and do nothing
}


Parameters

none

Returns

none




Edit History