TTP233 Touch pad with raspberry pi pico

Micropython code




 from machine import Pin

import time

Touch_pad = machine.Pin(16,Pin.IN,Pin.PULL_UP)#connect touch pad sensor in between GPIO16 and 3.3volt out of arspberry pi pico.

led = Pin(15,Pin.OUT)

Relay = Pin(17,Pin.OUT)

while True:

    if Touch_pad.value()==1:

        print("Touched")

        Relay.toggle()

        led.toggle()

        time.sleep(0.5)

Comments

Popular posts from this blog

4 Stage Timer With DS3231RTC Module.

Interfacing KY038 sound sensor with Raspberry pi Pico

Interfacing MQ2 Gas & Smoke Sensor With Raspberry Pi Pico