Touch

Touch

Detecting touch without having a button has become very common in the past few years. The technology is found on refrigerators, microwave ovens, and TVs. It is also similar to how touch screens work on phones and tablets.

Touch sensing relies on measuring a very small capacitance found in the environment. When a pin is touched by a finger, the capacitance is changed and a touch is detected. This is why this is sometimes called capacitive touch sensing.

For capacitive sensing to work, a 100pF capacitor needs to be connected between the desired pin and ground. Fear not, those are already found on pins 0, 1, and 2 on all boards.

Python

while(True):
    t = BrainPad.Touch.Read(0)
    BrainPad.System.Println(t)
    BrainPad.System.Wait(500)

C#

while(true){
    var t = BrainPad.Touch.Read(0);
    BrainPad.System.Println(t);
    BrainPad.System.Wait(500);
}

JS

while(true){
    let t = await BrainPad.Touch.Read(0);
    await BrainPad.System.Println(t);
    await BrainPad.System.Wait(500);
}

BrainStorm

Using the touch feature in BrainPad opens up great possibilities for us. How can we detect touch? Does this have anything to do with the human body’s conductivity of electricity?
Can we activate the touch feature using other things that conduct electricity? What about a banana?!

Content Licensing
Newsletter

Twitter Feed
Hot off the press!