T-Rex Auto Runner is an Arduino script for Google Chrome T-Rex Run game. Using micro servo and photoresistor it automaticly clicks spacebar at the right time, so basically it plays by its own (for now, it only works on the white level).
Photoresistor gets light level from the screen (white background) and if it gets a value below average (cactus) it sends a signal to micro servo to move propeller which clicks a spacebar, then Dino jumps.
If you want to build it, you would need:
- Any Arduino with 5V power output and with digital and analog pins (I used Arduino Uno),
- 220 Ohm resistor (I used this one, but you can also use different ones. I recommend checking out this guy's video: https://youtu.be/INekoMGeXac,
- Some wires,
- Breadboard,
- Photoresesitor,
- Tower Pro micro servo SG90.
Circuit for this project (circuit created with Tinkercad):
- Place photoresistor at that distance from Dino, that if it detects cactus, it immediately clicks spacebar (thanks to that it can go ad infinitum).
- Place servo properly on your spacebar, so the propeller can click it.
- Adjust code for your setup. It can various by:
- your screen size,
- your screen brightness,
- your display,
- yours monitor refresh rate,
- resistor and power you used for photoresistor.
- Lauch the code on your Arduino.
- Have fun! Now with your setup, Dino will go ad infinitum!