Search code examples
raspberry-pi3gpiogoogle-aiy

GPIO access from Voice Bonnet


I have a Google AIY Voice Kit. I want to use the raspberry pi to create a water dispenser system. I need access to the GPIO to connect relay and motors. Can I access them via Google Voice Bonnet or I have to remove it? I want to use the voice chip in parallel.

Any suggestions on how I can have direct access to the GPIO via voice bonnet?

Thank you


Solution

  • There are several GPIO pins available for use on the Voice Bonnet. You can access them through the gpiozero library and the aiy.pins package.

    There are example scripts available on the AIY GPIO Expansion Pins doc page, but your code would start with something like:

    from gpiozero import Motor
    from aiy.pins import (PIN_A, PIN_B) 
    
    motor=Motor(forward = PIN_A, backward = PIN_B)
    
    #Insert motor behavior here