Skip to content

Instantly share code, notes, and snippets.

@e-labInnovations
Created February 14, 2022 01:40
Show Gist options
  • Save e-labInnovations/324e062c525b0192a5c4cd218b5eedbb to your computer and use it in GitHub Desktop.
Save e-labInnovations/324e062c525b0192a5c4cd218b5eedbb to your computer and use it in GitHub Desktop.
Arduino based automated dino game
//HAASTTECH
#include <Servo.h>
#define threshold 250
Servo myservo;
bool trig = true;
void setup() {
myservo.attach(2);
myservo.write(70);
}
void loop() {
myservo.write(70);
delay(1);
if (analogRead(A0) < threshold)
{
myservo.write(36);
delay(100 );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment