Arduino Forum

Using Arduino => Installation & Troubleshooting => Topic started by: ktnch on Feb 08, 2011, 01:42 pm

Title: clock on arduino
Post by: ktnch on Feb 08, 2011, 01:42 pm
Need a little help, Trying to convert the code below for my controller, I have the arduino atmega 328 and this touch lcd http://www.nuelectronics.com/estore/index.php?main_page=product_info&cPath=1&products_id=18

With this data logging with rtc

http://www.nuelectronics.com/estore/index.php?main_page=product_info&cPath=7&products_id=20

Now can the arduino use the rtc of the data logger board or do i need a separate one


Any help will be great Thank you

Kev

How do i upload the code in its own box ? i have managed to attach the code that i need to modify though

Title: Re: clock on arduino
Post by: Korman on Feb 08, 2011, 02:57 pm
The clock on the datalogger seems to be a pretty standard DS1302 module, which you should be able to access with the libraries included in the Time library. As long as you don't have conflics between your boards with used pins, all should be fine.

Korman
Title: Re: clock on arduino
Post by: ktnch on Feb 08, 2011, 04:15 pm
Great stuff thank you, I got the two remain parts delivered but they sent the lcd for the larger version of the arduino board so have had to order another

kev
Title: Re: clock on arduino
Post by: ktnch on Feb 09, 2011, 01:26 pm
Need help as i am struggling a little, I am trying to merge the two sketches attached i have the sensor shield with the rtc built in and need the lighting code amended to use that rtc

Thank you

Kev

Title: Re: clock on arduino
Post by: Korman on Feb 09, 2011, 01:59 pm
Look at the samples for the Time library how to use it with the RTC and get the current time. That will save you a lot of hassles. No need to reinvent the wheel every time.

Korman
Title: Re: clock on arduino
Post by: ktnch on Feb 09, 2011, 02:03 pm
i am a complete newbie at this and at the min i am working blind
Title: Re: clock on arduino
Post by: TerryKing on Feb 09, 2011, 02:22 pm
Don't stay blind. Divide and conquer.

- Write a separate sketch for each major junction.  Fake input values if necessary.

- Put lots of intermediate results out to Serial Monitor.

- Get each subsystem to work first.

-Then review all the Constants, Variables, Libraries, subroutines for each subassembly and merge the stuff above SETUP on the simplest subassembly and make sure you can compile.

- Add the other code piece by piece, checking that you can compile OK

- Finally make the "real" data come from the "real" code and see if it works. Keep a lot of the Serial Monitor stuff working unless it messes up timing.

Slow down and make sure you understand each piece.

And Good Luck!

(Been There. Done That. Screwed It Up...)  :P
Title: Re: clock on arduino
Post by: ktnch on Feb 09, 2011, 06:45 pm
I have looked at the sketches and have not got a clue where to start think i need a 24/7 help line lol