Skip to content

Instantly share code, notes, and snippets.

@Rexypoo
Last active May 29, 2017 18:54
Segment of Google AIY main.py pertaining to triggers
if args.trigger == 'gpio':
import triggers.gpio
triggerer = triggers.gpio.GpioTrigger(channel=23)
msg = 'Press the button on GPIO 23'
elif args.trigger == 'clap':
import triggers.clap
triggerer = triggers.clap.ClapTrigger(recorder)
msg = 'Clap your hands'
else:
logger.error("Unknown trigger '%s'", args.trigger)
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment