SPANISH
Hola! Hice un alimentador de gato automatico y descargue los codigos. Mi problema es que solamente puedo modificar la hora y el movimiento del servomotor. Yo quiero que el servomotor gire de cierta forma en un horario y también gire de otra forma en un horario diferente.
Por ejemplo: Alimento a mis gatos con 3 vueltas a las 5AM y 8PM. Pero quisiera que mis gatos tengan una vuelta a las 5AM, 3 vueltas a las 8AM y 3 vueltas a las 8PM. Pueden ayudarme?
ENGLISH
Hi! I've made an automatic cat feeder and downloaded the code. My problem is that I can only change hour of release and move of the servomotor (duration and spin). I want to add an specific twist on one hour and another specific twist for another our.
For example: I feed my cats with 3 twist at 5AM and 8PM. But I want to feed my cats with one twist at 5AM, 2 twist at 8AM and 2 at 8PM. I want to separate that but I cant find the way. Can you help me?
Attached is the code. Thanks!
rotador.txt (1.44 KB)
Ya que estamos en la seccion de foro en español no tiene sentido que escribas en ingles. Luego siempre el codigo debe ir entre las etiquetas adecuadas.
#include <Servo.h>
#include <DS3231.h>
#include <Wire.h>
char *horas[]={"05:00","20:00"};
long nhoras = (sizeof(horas)/sizeof(char *));
bool h12;
bool PM;
DS3231 Clock;
Servo servoMotor;
byte year, month, date, DoW, hour, minute, second;
Existen librerias recomendadas y DS3231 no esta entre ellas, en cambio si esta RTClib.
#include <Wire.h>
#include <RTClib.h>
RTC_DS3231 rtc;
void setup () {
rtc.begin(DateTime(F(__DATE__), F(__TIME__))); //Poner hora correcta
}
void loop () {
DateTime hoy = rtc.now();
if (hoy.hour() == 5 && hoy.minute() == 0 && hoy.second() == 0){
//Tres vueltas
}
if (hoy.hour() == 8 && hoy.minute() == 0 && hoy.second() == 0){
//Una vuelta
}
if (hoy.hour() == 20 && hoy.minute() == 0 && hoy.second() == 0){
//Tres vueltas
}
}
@daniavellaneda26, ya te expliqué por privado que tu hilo fue movido del foro en inglés a este foro en español.
Por favor, edita tu post inicial y coloca el código (todo código menor a 9k debe verse) usando etiquetas.
@Kike_GL, evidentemente el puso eso en el foro en inglés y fue movido a este foro.
Por eso puso la traducción.
Código que no se lee, código que no respondo.