Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Greta Galli
Published © GPL3+

Chrome://dino

An easy way to hack the famous game of Google

IntermediateFull instructions provided1 hour1,621
Chrome://dino

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×2
Resistor 10k ohm
Resistor 10k ohm
×3
Photo resistor
Photo resistor
×3
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Tape, Scotch
Tape, Scotch

Story

Read more

Schematics

schematic of VF

Code

chrome://dino

Arduino
this is the code for the project
/*
 USE THIS ONLY FOR V1
 #include <Servo.h>
Servo servo1;
void setup(){
  Serial.begin(9600);
  servo1.attach(10);
}
void loop(){
  int val=analogRead(A0);
  Serial.println(val, DEC);
  if(val>400){
    for(int i = 0; i < 30; i++){
      servo1.write(i);
      delay(10);
    }
    for(int i = 30; i >= 0; i--){
      servo1.write(i);
      delay(10);
    } 
  }                        
}
*/

#include <Servo.h>

Servo up;
Servo down;
int jump = 400;

void setup(){
  Serial.begin(9600);
  up.attach(9);
  down.attach(10);
}

void loop(){

  //photoresistors
  int high=analogRead(A0);
  int low=analogRead(A1);
  int change=analogRead(A2);
  //Serial.println(val, DEC);

  do{
    //jump
    if(high>jump){
      for(int i = 0; i < 30; i++){
        up.write(i);
        delay(10);
      }
      for(int i = 30; i >= 0; i--){
        up.write(i);
        delay(10);
      } 
    }   
    //down
    if(low>jump){
      for(int i = 0; i < 30; i++){
        down.write(i);
        delay(10);
      }
      for(int i = 30; i >= 0; i--){
        down.write(i);
        delay(10);
      } 
    } 
  }while(change<jump);

 do{
    //jump
    if(high<jump){
      for(int i = 0; i < 30; i++){
        up.write(i);
        delay(10);
      }
      for(int i = 30; i >= 0; i--){
        up.write(i);
        delay(10);
      } 
    }   
    //down
    if(low<jump){
      for(int i = 0; i < 30; i++){
        down.write(i);
        delay(10);
      }
      for(int i = 30; i >= 0; i--){
        down.write(i);
        delay(10);
      } 
    } 
  }while(change>jump);
}

Credits

Greta Galli
4 projects • 21 followers
I am an eighteen italian girl and I like robotics and mechatronics. I've create a cybernetic hand only with Lego. Enjoy :)
Contact
Thanks to Farid Guliyev.

Comments

Please log in or sign up to comment.