Go Down

Topic: Need help to modify clock code (Read 587 times) previous topic - next topic

joe73

I had build clock from plans I found online and want to add 12/24 hour time and alarm to it.I am new to arduino and programming in general.Can someone modify code for me.For $$ or exchange for clock.
Here is link to clock build plans  http://www.vonnieda.org/tc18

Thanks

PaulS

If you want to make the clock display the hour in the range 1 to 12, instead of 1 to 24, the fix is simple. Change:
Code: [Select]
  byte h = Wire.receive();
to
Code: [Select]
  byte h = Wire.receive();
  if(h > 12)
    h -= 12;


"Adding an alarm" is not as trivial. The Arduino that is powering the clock certainly knows the time, and could sound an alarm at a specific time. But, setting that time requires user input, as would enabling, disabling, and silencing the alarm. Not to mention the need to add a noise maker. How will that user input be supplied?

Jack Christensen


If you want to make the clock display the hour in the range 1 to 12, instead of 1 to 24 ...


Ummm, how about 0 to 23?
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

joe73

I'm adding piezo to PB1 and PB2 thats pin 13 and 14 on atmega and want to set everything with rotary decoder.

PaulS

Quote
Ummm, how about 0 to 23?

Sure, that would work.

Go Up