Created
February 14, 2022 01:40
-
-
Save e-labInnovations/324e062c525b0192a5c4cd218b5eedbb to your computer and use it in GitHub Desktop.
Arduino based automated dino game
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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