#include <Servo.h> | |
Servo myservo; | |
const int servoPin = 9; | |
const int buttonPin = 12; | |
const int ledPin = 13; | |
void setup() { | |
myservo.attach(servoPin); | |
pinMode(buttonPin, INPUT); | |
digitalWrite(buttonPin, HIGH); | |
pinMode(ledPin, OUTPUT); | |
digitalWrite(ledPin, LOW); | |
myservo.write(180); | |
delay(1000); | |
myservo.detach(); | |
} | |
void loop() { | |
int buttonVal = digitalRead(buttonPin); | |
if(buttonVal == LOW) { | |
myservo.attach(servoPin); | |
myservo.write(30); | |
delay(575); | |
myservo.write(180); | |
delay(1500); | |
myservo.detach(); | |
delay(5000); | |
} | |
delay(13); | |
} |
This comment has been minimized.
This comment has been minimized.
Thanks |
This comment has been minimized.
This comment has been minimized.
What calls the "loop" function? |
This comment has been minimized.
This comment has been minimized.
hi there, where we can find the wiring diagrams? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
How many times a day does this feed. How do i adjust how much food is delivered. Do i just have to play around with the numbers? |
This comment has been minimized.
This comment has been minimized.
Idk what im doing wrong but its a continous loop for me. I would like to stop it after accessing the button but it does not stop. Can anyone help me please? |
This comment has been minimized.
This comment has been minimized.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
this is cool code for cat