1
00:00:00,720 --> 00:00:08,080
I let's show you how to use the 3-2 integrated capacitive touch sensor.

2
00:00:08,760 --> 00:00:15,750
Just wanted to Munyakei, you look familiar with this, that the inspectorates who has touched since

3
00:00:15,750 --> 00:00:19,380
says that are accessible via some of its typewriters.

4
00:00:19,860 --> 00:00:26,280
In particular, you've got touch sensors available here on your for zero two and 15.

5
00:00:26,550 --> 00:00:35,150
And on the other side right here, Chapuis, 27, 14, 12 and 13, it was 32 and 33.

6
00:00:35,640 --> 00:00:45,390
So you can use those sensors so that your attitude can detect when a user is touching a copper wire

7
00:00:45,720 --> 00:00:49,050
or a pad and therefore you can use it as a button.

8
00:00:49,050 --> 00:00:59,250
In a way, the E.S.P 32 micro python implementation gives you a module called capacitive touch right

9
00:00:59,250 --> 00:01:07,410
here, gives you that limitation here, which you can access by importing the touchpad function from

10
00:01:07,410 --> 00:01:08,700
the machine module.

11
00:01:09,120 --> 00:01:14,880
When you've got to do is to tell it which pin you want to use as a touch sensor and then create the

12
00:01:14,880 --> 00:01:21,500
object for that touch sensor and then use the read function to take a reading out of it.

13
00:01:21,510 --> 00:01:28,620
And depending on the integer that comes back from the read function, you can infer whether there has

14
00:01:28,620 --> 00:01:30,210
been a touch event or not.

15
00:01:30,660 --> 00:01:35,000
Down here you'll see an example implementation of a touch sensor.

16
00:01:35,730 --> 00:01:39,540
So I've got a very simple example here.

17
00:01:40,350 --> 00:01:44,590
Basically following the documentation I have connected.

18
00:01:44,610 --> 00:01:46,680
They just touch the pin here.

19
00:01:48,180 --> 00:01:59,160
From a hero to Jebril, 15, they have said that they say Tetrapod, here's the key object for TouchPad

20
00:01:59,160 --> 00:02:04,590
and then in an infinite loop, I just take readings and print them out to the shill.

21
00:02:05,490 --> 00:02:13,440
I found out empirically that if you take readings too quickly between each other, then this reading

22
00:02:13,440 --> 00:02:14,640
may not be very reliable.

23
00:02:15,000 --> 00:02:18,290
In my case, I had the authority looking out.

24
00:02:18,570 --> 00:02:24,030
So if you did take readings like these, just spaced them out at least 50 milliseconds apart.

25
00:02:24,840 --> 00:02:25,260
All right.

26
00:02:25,260 --> 00:02:33,540
So I've already copied this script onto the perpetrator's flash and she's got the square brackets around

27
00:02:33,540 --> 00:02:34,230
the filename.

28
00:02:34,620 --> 00:02:35,610
So it's ready to run.

29
00:02:35,920 --> 00:02:37,820
It's going to click on the play button.

30
00:02:39,460 --> 00:02:45,700
And I can use a jump away, of course, but just prefer to use the pin here, just keep things more

31
00:02:45,700 --> 00:02:47,290
tidy, just touching.

32
00:02:48,590 --> 00:02:58,460
Consider the value in the shell is changing, if I make more contact with the pin, the number becomes

33
00:02:58,460 --> 00:03:04,460
smaller so you can use these numbers in the range of numbers that come out to.

34
00:03:05,660 --> 00:03:06,200
Right.

35
00:03:06,350 --> 00:03:12,410
Appropriate code in your script so that you can detect these events and reject other events.

36
00:03:12,890 --> 00:03:18,350
Another thing that I want to show you is because the number that comes out of the shell in this printout

37
00:03:18,350 --> 00:03:22,490
example is just a single no Perreault.

38
00:03:22,890 --> 00:03:27,470
I can invoke the pleura and it gives a visual representation of.

39
00:03:28,870 --> 00:03:29,800
Touching the face.

40
00:03:32,270 --> 00:03:38,840
And looks quite interesting, but as you can see, it is a very simple way to implement a button like

41
00:03:38,840 --> 00:03:42,770
functionality has a touch interface with your PSP three gadget.
