Pages: [1]   Go Down
Author Topic: Looking for some help, need simple code for project  (Read 1127 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi dear Arduinist or Arduinista
being a harware guy i'm looking for some software help:
With the Rainbowduino(latest model out) i built a 12h clock-dial with 144 leds, thats one for each 5 min.
Now i need code that steps up one count (one led) each 5 min.
Someone outthere?? Could n't be too difficult, but writing code is not my cup.
Promise you my first proto for a helping brain.
Thanks,
Jacob

Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 208
Posts: 8842
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You should probably get a realtime clock (RTC) chip to track time.  The Arduino is not very good at it.

Code:
void loop()
    {
    int hour, minute;

    hour = RTC.GetHour();  //  Get the hour (0-11) from the RTC chip
    minute = RTC.GetMinute();   //  Get the hour (0-11) from the RTC chip

    int ledIndex =  ((60 * hour) + minute) / 5;
    }
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

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


How bad is the time keeping ?

I was planning a project using the arduino as the clock -- but it also will have a GPS clock

If the arduino is +/-  5% or so it would be OK for this project -- else, GPS I guess

thanks for the info
Logged

Offline Offline
Sr. Member
****
Karma: 0
Posts: 351
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

if you want a software RTC try swRTC library (its an open source one).
But if you have lack of knowledge to implement something as simple as a step up counter like the one you just said, dont you think its too big a project for you ?!?
Maybe start with smaller experiments, that will give you a better insight into the things you need to implement, but with simpler approaches, to start with. NOW THAT WOULD BE REWARDING !!

ps- Talk about swapping a salame for a pig !! lol
Logged

10 LET Loop=Infinite
20 GO TO 10

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 208
Posts: 8842
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How bad is the time keeping ?

I was planning a project using the arduino as the clock -- but it also will have a GPS clock

The Arduino might be off by minutes a day but if you correct it with GPS time once an hour or so that shouldn't be a problem.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

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


Thank you, John

If it is only a few minutes a day I probably can correct just once a day and be OK

Logged

Pages: [1]   Go Up
Jump to: