I let's show you how to use the 3-2 integrated capacitive touch sensor.
Just wanted to Munyakei, you look familiar with this, that the inspectorates who has touched since
says that are accessible via some of its typewriters.
In particular, you've got touch sensors available here on your for zero two and 15.
And on the other side right here, Chapuis, 27, 14, 12 and 13, it was 32 and 33.
So you can use those sensors so that your attitude can detect when a user is touching a copper wire
or a pad and therefore you can use it as a button.
In a way, the E.S.P 32 micro python implementation gives you a module called capacitive touch right
here, gives you that limitation here, which you can access by importing the touchpad function from
the machine module.
When you've got to do is to tell it which pin you want to use as a touch sensor and then create the
object for that touch sensor and then use the read function to take a reading out of it.
And depending on the integer that comes back from the read function, you can infer whether there has
been a touch event or not.
Down here you'll see an example implementation of a touch sensor.
So I've got a very simple example here.
Basically following the documentation I have connected.
They just touch the pin here.
From a hero to Jebril, 15, they have said that they say Tetrapod, here's the key object for TouchPad
and then in an infinite loop, I just take readings and print them out to the shill.
I found out empirically that if you take readings too quickly between each other, then this reading
may not be very reliable.
In my case, I had the authority looking out.
So if you did take readings like these, just spaced them out at least 50 milliseconds apart.
All right.
So I've already copied this script onto the perpetrator's flash and she's got the square brackets around
the filename.
So it's ready to run.
It's going to click on the play button.
And I can use a jump away, of course, but just prefer to use the pin here, just keep things more
tidy, just touching.
Consider the value in the shell is changing, if I make more contact with the pin, the number becomes
smaller so you can use these numbers in the range of numbers that come out to.
Right.
Appropriate code in your script so that you can detect these events and reject other events.
Another thing that I want to show you is because the number that comes out of the shell in this printout
example is just a single no Perreault.
I can invoke the pleura and it gives a visual representation of.
Touching the face.
And looks quite interesting, but as you can see, it is a very simple way to implement a button like
functionality has a touch interface with your PSP three gadget.