I've been trying out the built-in touch sensor commands, and tested a few different touch pads to see what (if any) difference there was between materials.
I tried out a solder blob (ala Erco - see his first video in post 5: https://picaxeforum.co.uk/threads/self-calibrating-touch-on-m2.31620/), aluminum tape and copper tape.
I looked at a couple of videos on soldering to aluminum, but I can't make it work. I've ordered some liquid flux and will give that a try. Right now the wire is just taped to it.
Top left: Solder blob
Right: Strip of copper tape, aluminum tape
Bottom left: Copper tape soldered into a square.
The manual suggests a 15mm x 15mm pad on the back of plastic. The yellow and black are leftovers from my 3D printer. The narrow strip of copper works but is hard to hit.
Copper tape is pretty easy to find, gardening stores have it. Here's how it's used:
I didn't see that much difference between the materials. The main thing you need to do in your code is determine the "ambient" level of reading and then set the detected level at the right number. I used the suggested code with some additions. The debug statements help you figure out what the right numbers are.
I tried out a solder blob (ala Erco - see his first video in post 5: https://picaxeforum.co.uk/threads/self-calibrating-touch-on-m2.31620/), aluminum tape and copper tape.
I looked at a couple of videos on soldering to aluminum, but I can't make it work. I've ordered some liquid flux and will give that a try. Right now the wire is just taped to it.
Top left: Solder blob
Right: Strip of copper tape, aluminum tape
Bottom left: Copper tape soldered into a square.
The manual suggests a 15mm x 15mm pad on the back of plastic. The yellow and black are leftovers from my 3D printer. The narrow strip of copper works but is hard to hit.
Copper tape is pretty easy to find, gardening stores have it. Here's how it's used:
Deter Slugs With Copper Tape | BBC Gardeners World Magazine
Follow our step-by-step guide to protecting your pot and container plants with copper tape. From the experts at BBC Gardeners' World Magazine.
www.gardenersworld.com
I didn't see that much difference between the materials. The main thing you need to do in your code is determine the "ambient" level of reading and then set the detected level at the right number. I used the suggested code with some additions. The debug statements help you figure out what the right numbers are.
Code:
symbol LED = C.2
symbol ReadTouch = 5700
#no_data
main:
touch16 C.1, w0 ; read value into w0
'debug ' Remove for final
if w0 > ReadTouch then
high LED ; output C.2 on
else
low LED ; output C.2 off
endif
'pause 10 ' Slows down debug display update, remove for final
goto main ; else loop back to start