Add the following snippet to your HTML:<iframe frameborder='0' height='385' scrolling='no' src='https://www.hackster.io/hashan_sudeera/automated-dino-game-using-arduino-c0a515/embed' width='350'></iframe>
This is My 3rd project with Arduino.
Read up about this project on
This is my third project in Arduino.
Circuit diagram
ThankYou.
I'mHashanSudeera.
#include <Servo.h> Servo con_servo; int ldr=A0; void setup() { Serial.begin(9600); con_servo.attach(9); pinMode(ldr,INPUT); } void loop() { int x=analogRead(ldr); if(x<100){ con_servo.write(4); } if(x>100){ con_servo.write(20); } Serial.println(x); delay(0.4); }
Please log in or sign up to comment.
Comments
Please log in or sign up to comment.