game, dino game play with arduino

Automated chrome dino game with Arduino

 Hi friends how are you, I know you get bored in lockdown, so I make this automated dino game with Arduino for you, This automated dino game is very easy to make in few steps at your home.

In this Automated dino game, I am using Arduino UNO you can also use Any Arduino board, and I know you get bored in this lockdown, then you can make build this project for fun, in this project we need Arduino microcontroller which is the brain of this projects, micro Servo motor, 10k ohm Resistor, connecting wire and most important thing LDR  (Light Depending Resistor) which sense the object in front of the dinosaur. When dark (object) comes on LDR then LDR sends the signal to Arduino analog pin (A0), as per the programming Arduino gives a signal to Digital pin 9 to activate the Servo motor.


As we know, we connected our servo motor to the laptop to press the space button. and just that this is the circuit of us. similarly, it keeps on working again and again. So how easy was to make It?


If you have any doubt in this project, then you can comment and ask me

Components required.

1.   Arduino ( Any Board )
2.   Servo Motor.
3.   LDR (Light Depending Resistor)
4.   10 K ohm Resistor.
5.    Connecting wires.



Watch my youtube video
 if you have any questions, then watch this video before commenting and if your question does not go away, then you can comment to me and ask.


Circuit Diagram




Coding

Copy and pest 


#include <Servo.h>

#define threshold 225   
#define unpress_angle 70 
#define press_angle 36


Servo myservo;  // create servo object to control a servo
bool trig=true;

void setup() {          
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
myservo.write(unpress_angle);   
}

void loop() {

 myservo.write(unpress_angle);              // unpress the button
 delay(1);
 if(analogRead(A0)< threshold)
 {
  
      myservo.write(press_angle);          // press the button
    delay(100 );                       // waits 100ms for the servo to reach the position
                      
 }                     
}


https://www.youtube.com/watch?v=B1ttxeciqQU

Comments

Popular posts from this blog

How to make talking Voltmeter at home

how to make taking distance measurement device using Arduino and ultrasonic sensor

How to make voltmeter using Arduino