Giter VIP home page Giter VIP logo

aiy_kit-led-servo's Introduction

AIY_Kit-LED-Servo

Using the AIY Voice Kit with LEDs and Servo Motors

There are 3 projects in this repository.

  1. Turn on and off 4 LEDs
  2. Control 2 Servo motors
  3. Control 2 Servo Motors and 4 LEDs

Pre-Requisite #1: Please enable billing by completing the Cloud Speech API tutorial first. https://aiyprojects.withgoogle.com/voice-v1/#makers-guide-change-to-the-cloud-speech-api

Pre-Requisite #2: Create a directory called 'src'

mkdir src

Project 1 - Turn on and off 4 LEDs

Materials: You will need 4 LEDs (red, blue, green, and yellow), 4 resistors of 330 ohms, wires, and a breadboard (or soldering iron).

  1. Connect the Red LED to GPIO26, Blue LED to GPIO6, Green LED to GPIO13, and Yellow LED to GPIO5. Wiring Diagram below.

alt text

  1. Use your favorite text editor to create your new file:
nano src/4led.py
  1. Copy the code from 4leds.py and paste into your 4led.py file.

  2. Save and close 4led.py by:

Ctrl-X
y
[Enter]
  1. Make the file you just created executable.
chmod +x /src/4led.py
  1. Run the file you just created.
src/4led.py

You should be able to command your AIY Kit with the following commands:

Ok Google, Red light on.

Ok Google, Red light off.

Ok Google, Blue light on.

Ok Google, Blue light off.

Ok Google, Green light on.

Ok Google, Green light off.

Ok Google, Yellow light on.

Ok Google, Yellow light off.

Ok Google, Primary colors on.

Ok Google, Primary colors off.

Ok Google, All lights on.

Ok Google, All lighs off.

Project 2 - Control 2 Servo Motors

  1. Connect one servo motor to GPIO26, and the second servo motor to GPIO6. You may need to solder header pins to the AIY Voice Hat. Wiring Diagram shown below.

alt text

I purchased servo motors here.

  1. Use your favorite text editor to create your new file:
nano src/servo.py
  1. Copy the code from servo.py and paste into your servo.py file.

  2. Save and close servo.py by:

Ctrl-X
y
[Enter]
  1. Make the file you just created executable.
chmod +x /src/servo.py
  1. Run the file you just created.
src/servo.py

You should be able to command your AIY Kit with the following commands:

Ok Google, wave.

Project 3 - Control 2 Servo Motors and 4 LEDs

Materials: You will need 4 LEDs (red, blue, green, and yellow), 4 resistors of 330 ohms, wires, soldering iron, and 2 servo motors. You may need to solder header pins to the AIY Voice Hat.

I purchased servo motors here.

  1. Connect one servo motor to GPIO26 (left), and the second servo motor to GPIO6 (right). Connect the Red LED to GPIO13, Blue LED to GPIO65, Green LED to GPIO12, and Yellow LED to GPI24. Wiring Diagram shown below. alt text

  2. Use your favorite text editor to create your new file:

nano src/ledservo.py
  1. Copy the code from servo-led.py and paste into your ledservo.py file.

  2. Save and close ledservo.py by:

Ctrl-X
y
[Enter]
  1. Make the file you just created executable.
chmod +x /src/ledservo.py
  1. Run the file you just created.
src/ledservo.py

You should be able to command your AIY Kit with the following commands:

Ok Google, wave.

Ok Google, wave right arm.

Ok Google, wave left arm.

Ok Google, Red light on.

Ok Google, Red light off.

Ok Google, Blue light on.

Ok Google, Blue light off.

Ok Google, Green light on.

Ok Google, Green light off.

Ok Google, Yellow light on.

Ok Google, Yellow light off.

Ok Google, Primary colors on.

Ok Google, Primary colors off.

Ok Google, All lights on.

Ok Google, All lighs off.

aiy_kit-led-servo's People

Contributors

carolinedunn avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

membb shujuuu

aiy_kit-led-servo's Issues

Wakeword LED

Im working on a magic mirror project and im only concerned about the lighting up of an external led connected to the setup during the OK GOOGLE hotword detection. How do I go about that?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.