Paper Signals is a Voice Experiment that lets you make little voice controlled objects that track simple things, like weather. You can build any of the example Paper Signals we have on g.co/papersignals, or use this repo to make your own Custom Signal.
This is an experiment, not an official Google product. We will do our best to support and maintain this experiment but your mileage may vary.
Paper Signals is built on Actions on Google, the platform that allows you to make things for the Google Assistant and the Google Home. It uses Dialogflow to handle understanding what the user says, Firebase Cloud Functions and Firebase Database for backend code and storing data, and Arduino for programming the electronics.
This repo contains the Arduino files used to make API calls and move servos. This lets users set up their own individual signals using the same Firebase and Actions backend that our pre-made examples use.
Instructions for how to set up one of the pre-made, example signals can be found at g.co/papersignals (including a more detailed explanation for setting up the electronics). Below in this README, we include instructions on how to make a Custom Signal and set up a Custom Intent.
Custom Intents allow you to program your Paper Signal to track anything with a few lines of code and voice commands. Creating and programming a custom intent can be done in 4 steps.
Open the Paper Signals code in Arduino and use the tabs to open the APICalls.h file.
Use the tabs on the top of the Arduino Software to open the APICalls.cpp file.
Any code written in this function will run when you ask Paper Signals to run your custom intent. The variable CustomIntentData is a string that represents any parameter you gave your custom intent.
To run your custom intent, open Paper Signals and say “Talk to Paper Signals”, then “Create a new Signal called Custom Signal.” Once you have that created, say “set my Custom Signal to a custom intent named ”
- Example: “Set my Custom Signal to a custom intent named power.” In this example, Custom Signal is the signal name and Power is the custom intent name.
To set a parameter for your custom intent to use, say: “Set the custom Parameter for Custom Signal to ”
- Example: set the custom parameter for Custom Signal to Fast. In this example, Custom Signal’s custom intent is going to use Fast as a custom Parameter
Programming Your Custom Intent Functions
You will usually want to move servos and check online APIs with your custom intents, so there are 2 chunks of very useful code to understand.
Getting API Data
- Paper Signals has a function for moving a servo with default settings. The position argument of this function takes an angle between 0 and 180 (This is the angle that the servo will move to), and speed takes an integer. Speed is actually the amount of time spent on each single angle of the servo. So a lower speed value will make the servo move faster.
- The example below moves the servo to 20 degrees, spending 10ms on each degree between the angle the servo is started at and the destination.
Copyright 2017 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
We encourage open sourcing projects as a way of learning from each other. Please respect our and other creators’ rights, including copyright and trademark rights when present, when sharing these works and creating derivative work. If you want more info on Google's policy, you can find that here.