This program simulates a dual dice throw by pushing the 2 buttons on the QW dev kit. The results of the throw are shown in binary on the leds, printed in the console window and transmitted via Sigfox.

Dependencies:   mbed

Fork of QW-BinaryDices by Quicksand

QW Binary Dices

This program simulates a dual dice throw by pushing the 2 buttons on the QW dev kit. The results of the throw are shown in binary on the leds, printed in the console window and transmitted via Sigfox.

Code explanation

The program starts with the initialisation/declaration of the leds and pushbuttons. Also the necessary function prototypes and serial communications are declared. After that, the program enters an infinite loop and waits till both buttons have been pushed. Once both buttons have been pushed, the result is shown in binary on the leds (LED_3 = LSB), printed in the console window and transmitted via Sigfox. When the Sigfox message is transmitted, the program is ready to throw the dices again.

Sigfox message payload

First there is the "04", this is the Quicksand ID of the example program. This is used by Quicksand to keep track of our example programs. The second value that is transmitted is the number that was thrown by the dices.

More information and other example code can be found on the component page by clicking the link below: https://developer.mbed.org/components/QW-SIGFOX-Development-Kit/

Committer:
quicksandjonas
Date:
Tue Dec 13 16:52:23 2016 +0000
Revision:
1:00a17f5a247c
Parent:
0:6c17d1a79f75
This program simulates a dual dice throw. The result is shown in binary on the 4 leds and is transmitted via Sigfox.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
quicksandjonas 1:00a17f5a247c 1 http://mbed.org/users/mbed_official/code/mbed/builds/d75b3fe1f5cb