MakerWorld
Pets
Vai al Modello
Automatic fish feeder
51
Download
24
Likes
15
Makes
Automatic fish feeder for aquarium tank Atman AR-380. This automatic fish feeder feeds the fish once per day. To make this work you need: - Arduino (Nano) - Servo motor (TowerPro SG90) - Power supply - few cables Below is the code used for this project: #include <Servo.h>Servo mojServo;unsigned long vrijemeZadnjegPokretanja = 0;const unsigned long danUMilisekundama = 86400000; // 24 h = 86,400,000 msvoid setup() { mojServo.attach(9); // servo is connected to pin D9 mojServo.write(0); // starting position vrijemeZadnjegPokretanja = millis(); // set start time}void loop() { unsigned long trenutnoVrijeme = millis(); // if 24 hours have passed if (trenutnoVrijeme - vrijemeZadnjegPokretanja >= danUMilisekundama) { // servo motor start from 0° to 180° for (int kut = 0; kut <= 180; kut++) { mojServo.write(kut); delay(15); // Polagano okretanje } // pause briefly if you want him to hold the position for a while delay(2000); // 2 second pause // rewind from 180° to 0° for (int kut = 180; kut >=
Hai stampato questo modello? Accedi e condividi il tuo make!
Accedi per lasciare un commento
AccediAncora nessun commento – sii il primo!