Sanasar
Published © GPL3+

Smarty Pants Tap

Super FUN family trivia where you have 90 seconds to answer as many questions correctly. But you need to be quick and tap your button first!

IntermediateShowcase (no instructions)6 hours361
Smarty Pants Tap

Things used in this project

Hardware components

Amazon Echo
Amazon Alexa Amazon Echo
×1
Amazon Alexa Echo Buttons
×1

Software apps and online services

Alexa Skills Kit
Amazon Alexa Alexa Skills Kit
AWS Lambda
Amazon Web Services AWS Lambda

Story

Read more

Schematics

Amazon Alexa - Echo Buttons Schematic

This is the current schematic on how the skill works with Alexa and Echo buttons. Original source: https://developer.amazon.com/docs/gadget-skills/understand-gadgets-skill-api.html

Code

Smarty Pants Tap Winner

JavaScript
Blinking animation to denote the winner of the round
// GRABBED FROM: https://developer.amazon.com/docs/gadget-skills/echo-button-animations.html
// ANIMATION: BLINK
function blinkAnimationBuilderHelper(targetGadgets, index, triggerEventTimeMs) {
const animationsArray = [
{
repeat: 8,
targetLights: ['1'],
sequence: [
{
durationMs: 250,
color: COLORS[index].dark,
blend: false,
},
{
durationMs: 250,
color: COLORS[index].hex,
blend: false,
},
{
durationMs: 250,
color: COLORS[index].light,
blend: false,
},
{
durationMs: 250,
color: '000000',
blend: false,
},
],
},
];

this
.alexaSkill()
.gadgetController()
.setNoneTriggerEvent()
.setAnimations(animationsArray)
.setLight(targetGadgets, triggerEventTimeMs);
}

Credits

Sanasar

Sanasar

1 project • 0 followers

Comments

Add projectSign up / Login