import time import board import touchio from adafruit_hid.consumer_control import ConsumerControl from adafruit_hid.consumer_control_code import ConsumerControlCode touch_A1 = touchio.TouchIn(board.A1) # Not a touch pin on Trinket M0! touch_A2 = touchio.TouchIn(board.A2) # Not a touch pin on Trinket M0! cc = ConsumerControl() while True: if touch_A1.value: print("Touched A1!") cc.send(ConsumerControlCode.VOLUME_INCREMENT) while touch_A1.value: pass if touch_A2.value: cc.send(ConsumerControlCode.VOLUME_DECREMENT) while touch_A2.value: pass