Pages: [1]   Go Down
Author Topic: Need help to modify clock code  (Read 494 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 551
Posts: 46255
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
  byte h = Wire.receive();
to
Code:
  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?
Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 71
Posts: 3536
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 551
Posts: 46255
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Ummm, how about 0 to 23?
Sure, that would work.
Logged

Pages: [1]   Go Up
Jump to: