Now that your accounts are set up, log in to Temboo and go to the Nexmo > Voice > CaptureSpeechToTextPrompt Choreo in the Temboo Library. Turn on IoT Mode and select Texas Instruments LaunchPad and TI CC3200 LaunchPad (WiFi) from the dropdown menus. In the pop-up that appears, give a name to your board (so that you can find it again for future projects), and also fill in your wireless network information (this will enable Temboo to generate code that is preconfigured to work with your network).
Select Is this Choreo triggered by a sensor event? to choose the pin to which you will attach your moisture sensor; the program that you generate will include the code to have data from your moisture sensor trigger the Nexmo Choreo. In the conditional that appears, switch the pin type to analog, the operator to <, and the value to 300 (the maximum value that the Grove moisture sensor should register for dry soil; you'll probably need to adjust this value to find the threshold that works best for you). Then, to select the pin you want to use, click the number in the blue circle; this will allow you to use the graphical pin board on the right of the page to indicate the pin to which you will be attaching your sensor. For now, let's use pin 60. When you're finished, your setup should look like this:
Next, fill out the Input fields using the information from your Nexmo account; you can find your Nexmo API Key and Secret in the API Settings menu on the top right of the Nexmo dashboard. Also fill in the number you’re calling (probably your own), what you want the call to say, and how many digits you want Nexmo to listen for as a response.
Once you've filled out all of the Input fields on the CaptureSpeechToTextPrompt Choreo page, test the Choreo from your browser by clicking Run at the bottom of the window. Two things should happen. First, you should actually receive the call from Nexmo. Then, once you’ve taken the call and pressed a number on your phone’s keypad in response, you should see that number appear in the Response box located under Output (which you’ll find by scrolling down the page a bit).
Also under Output, you'll find the option to select Should an output trigger a hardware event? This interface corresponds to the input trigger that you set up earlier, and is what we'll use to specify the conditions under which the servo motor should be turned on. Set the output field to Digits, the operator to =, and the value returned to 1. Also set the board to write High to Digital pin 59; we'll adjust some of this later as we make the servo's behavior more complex, but for now, it's useful placeholder information. Your output trigger setup should look like this:
Text editor powered by tinymce.