MasterMind - RotaryDial

A slightly weird idea. Here I had an old telephone rotary dial, and had worked out how to "read" the dialling, with some simple Arduino code (10 lines). Now what to use it for? The un-original idea: "guess a number". 1,2 or 4 digits by simple binary search and a LED to show Hi/Low. And then I thought of Mastermind where you guess 4 colours, and get a clue about right number right/wrong place.

Thus this little gadget

It plays both the simple Hi/low guess and MasterMind (with different degrees of difficulty) The front picture shows one Green and one Red Led - they are two colour LEDs - so my last attempt got one digit all correct, and one digit in the wrong place and the other two way off.

Code is in attached file

DrejeMasterMind.V2 (10.1 KB)

Inspiring tinkering!

Do you have pictures of people gazing at you when you play with this device in a bus or train :slight_smile:

Edit done to top post - added a bit about two-colour LEDs

@robtillaart: no, not yet. :wink:

Found a bug and some needed improvements
1: Choosing game 5 and 7 now correctly has correct digit range
2: Show all green LEDs after win for 5 seconds,
3: Start a new game of same type after 10 seconds after win
4: removed the timeout if users pause for too long

DrejeMasterMind.ino (10.6 KB)