TOUCH channel, variable
Channel - is a variable/constant specifying the ADC channel (not pin number)
Variable - receives the byte touch reading
Read the touch sensor on the ADC channel and save reading into byte variable.
This command automatically configures the pin as an ADC and as a touch sensor. Note that the touch command is a 'pseudo' command that actually processes a touch16 command and then scales the 16 bit result to fit in a byte (to give a byte reading 0-255). This makes byte mathematics easier in simple programs but does mean that the touch sensor accuracy is reducing by the scaling process. When possible it is recommended that a touch16 command with a word variable is used instead. This will maintain the highest possible accuracy.
Please note that the touch reading can be affected by long serial cables connected to the project PCB (e.g. the older AXE026 download cable). Therefore it is not recommended that the older AXE026 serial cable (or AXE026/USB adapter combination) is used when trying to calibrate the touch command as it can affect the readings, only use the AXE027 USB cable for this calibration.
Due to the design of the silicon inside the microcontroller each pin will give slightly different readings. Therefore each pin must be calibrated separately. See the touch16 command description for more details about using touch sensors.
Affect of increased clock speed:
The clock speed will affect the count rate and so the result will change for each clock speed. Therefore the touch command must be calibrated at the actual clock speed in use.