loading
3Comments

Tell us about yourself!

Complete Your Profile
  • ElishebaW commented on Constructed's instructable Arduino Fish Feeder9 months ago
    Arduino Fish Feeder

    Here's the correct code. I fixed it.#include <Servo.h> // create servo object to control a servo // a maximum of eight servo objects can be created Servo myServo; // variable to store the servo position long FISHFEEDER = 80; // 12 hours between feedinglong endtime; long now;void setup() { myServo.attach(9); // attaches the servo on pin 9 to the servo object myServo.write(180); delay(15);}void loop() { int position; now = millis(); endtime = now + FISHFEEDER; while(now < endtime) { myServo.write(0); delay(20000); now = millis(); } for (position = 0; position < 180; position += 1) // goes from 0 degrees to 180 degrees { // in steps of 1 degree myServo.write(position); // tell servo to...see more »Here's the correct code. I fixed it.#include <Servo.h> // create servo object to control a servo // a maximum of eight servo objects can be created Servo myServo; // variable to store the servo position long FISHFEEDER = 80; // 12 hours between feedinglong endtime; long now;void setup() { myServo.attach(9); // attaches the servo on pin 9 to the servo object myServo.write(180); delay(15);}void loop() { int position; now = millis(); endtime = now + FISHFEEDER; while(now < endtime) { myServo.write(0); delay(20000); now = millis(); } for (position = 0; position < 180; position += 1) // goes from 0 degrees to 180 degrees { // in steps of 1 degree myServo.write(position); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } for (position = 180; position>=1; position-=1 ) // goes from 180 degrees to 0 degrees { myServo.write(position); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } }

    You just kinda pick it up from starter kits and peoples projects online. It's based off C++ tho.

    View Instructable »
  • ElishebaW commented on Constructed's instructable Arduino Fish Feeder9 months ago
    Arduino Fish Feeder

    They calculated it in milliseconds 3600000= 1 hour

    View Instructable »