Dinosaur Game Hack Google chrome games

Spread the love

No internet dinosaur game (Trex run) is a fun game. This dino game will appear on no internet connection page. The second method to open this game is to put your device on Flight mode and open google chrome. Keep pressing the space bar again and again and let Trex jump to save from the cactus plant is become a boring task. Let’s try a new way to do this. Here we will make Dinosaur Game Hack in a totally different way.

Material Required

  • Arduino UNO
  • LDR (light dependent resistor)
  • 10k ohm resistor
  • Servo motor
  • Jumper wires
  • breadboard
  • USB Cable
  • Google chrome on a PC for Dinosaur Game Hack

LDR (Light-dependent resistor)

About LDR

LDR () also known as a photoconductor. It is basically a photocell that works on photoconductivity. This is basically a resistor whose value is decrease when the intensity of light is decreases. This component is use in Street light, Camera, Light beam alarm, etc.

Structure and working

LDR
LDR Working

The main component for the LDR is cadmium sulphide (CdS), which is used as the photoconductor and contains very few electrons when not illuminated. As soon as light falls on the sensor, the electrons are liberated and the conductivity of the material increases. When the light intensity exceeds a certain frequency, the photons absorbed by the semiconductor give band electrons the energy required to jump into the conduction band. This causes the free electrons or holes to conduct electricity and thus dropping the resistance dramatically (< 1 Kiloohm).

R = A.E^a

where E – Illumination (lux)
R – Resistance (Ohms)
A, a – constants

LDR Connection with Arduino

If you use LDR directly with Arduino it may give some floating values. To avoid this we use a pull-up or pull-down resistance with it. In this trex run we are using pull-down resistance.

Software

Arduino digital pins have in-build pull-down resistance. We can initialize using the software. The Arduino code syntax is:-

pinMode(2, INPUT_PULLUP);

Hardware

This method is recommended you need a 10k ohm resistance. With the help of a 10k ohm resistance connect input pin and GND. As shown in the following schematics. Source:- wikipedia

LDR
Pull-down resistance connection

Servo motor

A servo motor is a close loop system, that allows for precise control of angular position. It has 3 wires system red, brown and yellow for supply, GND, and signal.

Servo motor
Servo motor wires

Servo motor Arduino

The connection of servo motor with Arduino is very simple. Connect servo motor red wire to Arduino 5v, Black wire with GND, and yellow wire to pin number 9.

Servo wire colorArduino pin number
YellowPin No. 9
Red5v
Brown/BlackGND
Connection table
servo motor with arduino
Connection diagram

Final Connection

Final connection of Google chrome games is very simple. Connect everything according to following schematic diagram.

Arduino Pin no.LDRServo motor10k ohm Resistor
A0First LegFirst Leg
9Yellow wire
GNDBlack WireSecond Leg
VCCSecond LedRed wire
Dinosaur Game Hack
final schematic of Dinosaur Game Hack

Installation on Computer

Step:- 1

With the help of a tape stick LDR facing toward screen leaving 1cm space from Dino Google.

Dinosaur Game Hack

Step:- 2

With the help of tape stick Servo motor near space bar, Such a way the shaft of motor hit the space bar.

Step:- 3

The final output will be like this.

Coding for trex run

#include<Servo.h>

Import Servo motor library.

define LDR A0 //attache LDR data pin to arduino pin no 3
Servo myservo;

Defining analog pin A0 as LDR & Servo as myservo

void setup() {
pinMode(LDR, INPUT);
myservo.attach(9);
Serial.begin(9600);
}

In void setup function, I am telling i will use LDR(A0) pin for input and my servo will attach to pin no. 9. Also establishing a Serial communication at baud rate 9600.

void loop() {
int senseValue = analogRead(LDR);
Serial.println(senseValue);

In loop function we are reading LDR value and assign that value to senseValue variable And display it serial.

if (senseValue > 600)
{
myservo.write(0);
}
else
{
myservo.write(100);
delay(150);
}
}

Here we are making a condition to decide the position of servo. we know that LDR gives value according to light intensity. so it will detect the cactus and write the servo from 0 degree angle to 100 degree angle. which result the space bar will pressed. and Trex will jump

Final code copy and upload on your Arduino board

# include <Servo.h>
define LDR A0 //attache LDR data pin to arduino pin no 3
Servo myservo;
void setup() {
pinMode(LDR, INPUT);
myservo.attach(9);
Serial.begin(9600);
}
void loop() {
int senseValue = analogRead(LDR);
Serial.println(senseValue);
if (senseValue > 600)
{
myservo.write(0);
}
else
{
myservo.write(100);
delay(150);
}
}
Final Product

Add a Comment

Your email address will not be published. Required fields are marked *