how do I add sounds to the adafruit capacitive touch hat?

时间:2019-01-09 22:06:38

标签: python python-3.x raspberry-pi raspberry-pi3 adafruit

I recently bought a Raspberry Pi and an Adafruit Capacitive Touch Hat. I have the solution to detecting when the bord gets touched but I don’t now how to add some sounds to it. Can anybody help me to find a solution?

This is the working code that I have:

import time
import board
import busio
import adafruit_mpr121

i2c = busio.I2C(board.SCL, board.SDA)

mpr121 = adafruit_mpr121.MPR121(i2c)

while True:

for i in range(12):

    if mpr121[i].value:

        print('Input {} touched!'.format(i))

time.sleep(0.25)

0 个答案:

没有答案