Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. import time # librería delay
  2. import board # librería placa
  3. import touchio # librería touch
  4.  
  5. touch_pad = board.A2 # Seteo pin (A0 a A5)
  6.  
  7. touch = touchio.TouchIn(touch_pad)
  8.  
  9. while True:
  10. if touch.value:
  11. print("Tocado!")
  12. time.sleep(0.05)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement