Translate

vendredi 1 mai 2020

automatic dino game offline

here's a little game made by google chrome when the computer is offline.  thanks to arduino it possible to play it automatically without pressing a key. It based on an arduino uno, a photoresistor(LDR),a 1K resistor, and a servo motor.
The photoresistor detect the light from obstacle which are trees in the game and send to arduino a value different then before, if this value is equal or greater than a defined value in arduino then the servo motor rotates  90 degree and presses the space button on the keyboard for 250 milliseconds, after this the dino jump the obstacle.



This is the schematic

















this is the code below:

#include <Servo.h>
int pot=A0;
int val;
Servo myservo;
void setup() {
  Serial.begin(9600);
  myservo.attach(9);
}

void loop() {
  myservo.write(90);                           
  val=analogRead(pot);
  Serial.println(val);
  if(val>=730){
   myservo.write(0);
   delay(250);
   myservo.write(90);
  }                                                     
}


jeudi 30 avril 2020

announcement

Hi guys welcome to my blog, I am KEVIN MWEN I am an electronic engineer. In this blog I will share with you some electronics project that I make because I like to share my knowledge with others to help them. Currently ARDUINO is the most popular devellopment board for making electronic projects but there are also some others board like ESP8266 nodemcu or ESP32...they are good board, I will do project with all board that I can and  electronics project based on active component such as transistor, integrate circuit...
If you have some trouble or some remark don't be shy to let me know with coments or text me.            I hope  you will enjoy my  blog

automatic dino game offline

here's a little game made by google chrome when the computer is offline.  thanks to arduino it possible to play it automatically without...