Sixteen-year-old Austin Wilson loves building things. He enjoys figuring out how things are put together then finding ways to improve on them.
When Austin’s uncle noticed the teen’s knack for problem solving, he urged Austin to learn to code. That was five years ago, and the high school junior from Rocky River, Ohio has learned a number of programming languages since.
Last summer, Austin interned at a software company where he added C# and ASP.NET to the list. As his next step, he wanted to add artificial intelligence to his Raspberry Pi (RPi). A Google search led Austin to Hackster’s Internet of Voice Challenge (IoV) with Raspberry Pi where he discovered Alexa.
After building several small skills using templates, Austin was ready to build a skill for the competition—something with an element of fun, he thought. His idea: build an Alexa skill that controls a motorized model car. The skill needed to move the car forward and backward, turn it left and right, and bring it to a stop. Austin also wanted it to change the color of the car’s LED lights.
To communicate between the skill and the RPi, Austin used the PubNub publish/subscribe API. Here’s how Austin made Alexa control the car:
User asks Alexa: “Move the car forward”
Alexa skill publishes the “move forward” message to PubNub
The RPi (on car) receives the message and compares it to known commands
The RPi sends a signal to the Arduino controller to engage the wheel motor
Austin looked to reimagine the third-party voice packs that give Elite players voice control over their starships. The packs, which use Windows Speech Recognition, associate certain vocal commands to a keyboard key press. Once the command runs, the packs play a pre-recorded audio file for the player.
These static audio responses left Austin wanting. He wanted the ability to ask Alexa for details about the ship’s status and the space ahead. So he set out to develop just that.
First, he integrated the StarMap API, a public API from the Elite Dangerous gaming community, so he could ask Alexa for detailed information on star systems. When asked, the Alexa skill calls the StarMap API to retrieve the data and relay it to the pilot.
Next, Austin needed to send voice commands between Alexa and the game. Austin again used the PubNub messaging API, and he wrote a C# program to relay the messages between Alexa and the game. When the pilot asks Alexa to lower the landing gear, for example.
Alexa skill identifies the command and publishes a message to PubNub.
The C# application receives the message from PubNub, maps it to a key press the game will recognize, then executes a virtual key press.
The game receives the key press and lowers the landing gear.
Austin also wanted to hear real-time game status including the results of the executed voice commands. He learned that Elite records every ship event in a log file. So he extended his C# app and added a universal Windows app to include the following functionality:
The C# app detects changes in the log file, filters out unwanted events, and stores the relevant ones.
The universal Windows app reads the stores events and publishes them as messages to PubNub.
When the pilot asks, Alexa retrieves (and vocalizes) the last messages from PubNub.
What’s next for the award-winning Alexa skill builder?
“I think I'm going to take a little break now,” says Austin. “After all, I’m a junior, and I have to start choosing and applying to colleges pretty soon.”
Still, Austin says there’s “one more contest I might enter.” It’s a contest centered on the future of smart homes—an area where both Alexa and Austin will shine.
Stay tuned to see what creative skill Austin builds next for Alexa. In the meantime, Austin has this advice for fellow Alexa developers: “Amazon has a lot of documentation and tutorials on Alexa. Go through the tutorials and just keep practicing. That’s what I did. I just kept practicing, until I became confident enough to build the car.”
Build a Skill, Get a Shirt
The Alexa Skills Kit (ASK) enables developers to build capabilities, called skills, for Alexa. ASK is a collection of self-service APIs, documentation, templates, and code samples that make it fast and easy for anyone to add skills to Alexa.