Boa noite,
Estou desenvolvendo um projeto com relógio que contem despertador.
Como faço para colocar 3 push button ( set, incrementa, descrementa), para que possa configurar o horário e o despertador do relógio MANUALMENTE!?
para fazer o relógio, estou usando módulo rtc ds3231!
Já procurei em toda parte, mas não consigo entender a programação e muita das vezes não achei-a.
Se alguém poder me ajudar...
Abraços!
Tags:
http://arduinotehniq.blogspot.jp/2014/09/manual-adjust-for-rtc-cloc...
esse eh o codigo do link arduinotehniq, ele esta usando 1307 mas eh a mesma coisa 3231 ou 3232
a partir da linha 129 tenta entender setTime
tem varias versoes de biblioteca para o seu module 3231, algumas com opcao de 2 alarmes.
olha essa biblioteca e na intrucao ele esta dizendo isso;
set(time_t t)
Description
Sets the RTC date and time to the given time_t value. Clears the oscillator stop flag (OSF) bit in the control/status register. See the oscStopped() function and also the DS323x datasheet for more information on the OSF bit.
Syntax
RTC.set(t);
Parameters
t: The date and time to set the RTC to (time_t)
Returns
I2C status (byte). Returns zero if successful.
Example
//this example first sets the system time (maintained by the Time library) to
//a hard-coded date and time, and then sets the RTC from the system time.
//the setTime() function is part of the Time library.
setTime(23, 31, 30, 13, 2, 2009); //set the system time to 23h31m30s on 13Feb2009
RTC.set(now()); //set the RTC from the system time
tenta primeiro fazer apenas mudar o horario usando botao, aprendendo isso na sequencia tenta adicionar a funcao de alarme, conseguindo, tenta 2 alarmes.
Bem-vindo a
Laboratorio de Garagem (arduino, eletrônica, robotica, hacking)
© 2024 Criado por Marcelo Rodrigues. Ativado por