brentstineman / ButtonPong

A sample lab that demonstrates a simple game using Azure Serverless and Particle Internet Button Devices
MIT License
4 stars 14 forks source link

Added Winner Firmware Handler #18

Closed mikaelweave closed 6 years ago

mikaelweave commented 6 years ago

There was an event already fired to the Particle API from the Azure function to signal the winning device but no function on the firmware to catch it.

We added a firmware function to light up and play a sound on the winning device.

brentstineman commented 6 years ago

There's already handling for the game winner event. This is based on getting a "ping" command with a "-1" timeout value. The choice was made to reuse the "ping" method and not stand up another method just for this functionality.

Code in question: https://github.com/brentstineman/ButtonPong/blob/master/firmware/src/buttonpong.ino#L160-L166