Now toss the coin digitally using digital tosser. Its built using Arduino UNO, LCD(2x16) and push button. When you like to choose heads the key should be pressed, for tails don't press the key.
You can setup the circuit given in schematics.
It is necessary to include LiquidCrystal.h library in the arduino code. In the program I have called a random function which chooses 1 or 2. 1 for heads and 2 for tails. First condition is that when key is pressed and r=1, user has won, second condition is key not pressed and r=2, user has won. In the else part loosing condition is added that is user chooses heads and gets tails or user chooses tails and gets heads.
Comments
Please log in or sign up to comment.