May 11th, 2021—
There has been a trend over the past few years to automate certain games using microcontrollers — especially mobile ones. But none are perhaps as popular as the Dinosaur Game that shows up whenever the Chrome browser lacks an Internet connection. The game is simple: just tap or click to make the little T-Rex jump over various obstacles. And even though Arduino projects already exist that play perfectly for you and run the game, what about combining the two? This exactly what Michael Klements did with his Arduino Uno that plays the dino game on another Uno.
The game itself runs on an Uno with an LCD keypad shield stacked on top which displays the sprites and exposes a couple of buttons for player interactions. He got the code from a different project and loaded it. From here, there is the challenge of knowing when to press the button to make the dinosaur jump, as the cacti are spaced at random intervals along the field. So rather than doing anything fancy, he connected a photoresistor and an LED to an Arduino that detect the presence of cacti and actuate a servo motor accordingly.