Jump Cacti With An LDR And A Pico

A light-dependent resistor detects cacti in the Google Chrome Offline Dinosaur game.

By now, probably everyone is familiar with the “You’re Offline” dinosaur that stars in Google’s T. Rex game. You know — jump cacti, avoid pterodactyls. Repeat until you lose, or, we suppose, make the leaderboard. Well, what if you theoretically couldn’t lose? That’s kind of the idea behind [Bas BotBerg]’s cactus detection-and-avoidance scheme (translated from Dutch).

Like many of us, [Bas] firmly believes that repetitive tasks should be automated, and that includes the controls of the famous T. Rex. Since the cacti are always dark gray and appear along the same plane, it’s easy to register the difference between cacti and screen electronically. In order to accomplish this, [Bas] is using a light-dependent resistor and a pull-up resistor to create a resistance bridge, which is then connected to an analog input pin on a Raspberry Pi Pico.

But [Bas] didn’t do this just to cheat at Offline Dinosaur. Really! It’s for educational purposes, to get people comfortable with embedded processing, sensors, and interfaces between different devices. Check it out in brief action after the break.

Once they get familiar with these concepts, maybe introduce the ESP32 version of Offline Dinosaur.

6 thoughts on “Jump Cacti With An LDR And A Pico

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.