Page 1 of 1

C Code - just a pointer..

Posted: Fri Jan 17, 2014 7:47 am
by vk3jap
Hi Guys,

Way New to Arduino.. but have written Shell, PERL, PYTHON, PHP, BASIC.. and played a fair bit with PICAXE - just because I've tinkered, doesn't meen I've mastered!

so I am real new to C, been playing seems ok. I have played with the sketch that just flashes D13, the one that allows me to talk to the DS3232 board etc - all good. So now I would like to just have a sketch that flashes D13 twice, reads the time in(non interactive to the console user) an does a serial print. So I am thinking, just take bits and pieces from the code I have been using, which I tried, but then I got compile errors about variables not being defined, labels unknown etc etc. I think what's confusing me is I don't know what is a C core statement, and what is a function from a .H file etc.

SO.. I went and opened up a .H file (DS3232RTC.h) and then RTC.H etc.. they're pretty full on. I guess what I'm thinking is I don't want to write a full set of code from the ground up, but these .H files - are they documented.. ie at a high level can a dummy like me look for a doco on RS3232RTC.h which tells me how to use it, what syntax to use and what to expect back etc..?

Appols for perhaps stupid question!

please tell me there are some people in the Australian time zone on here :-)

Ian
(Melbourne, AU)

Re: C Code - just a pointer..

Posted: Fri Jan 17, 2014 10:39 pm
by jebz
You need to put the RTC and DS3232 libraries in the Arduino libraries folder then restart the IDE. Then from the File menu open the examples menu and browse for your examples relating to hardware time devices. This will give you a good start.

Re: C Code - just a pointer..

Posted: Fri Jan 17, 2014 11:00 pm
by andrew
vk3jap wrote:Hi Guys,

Way New to Arduino.. but have written Shell, PERL, PYTHON, PHP, BASIC.. and played a fair bit with PICAXE - just because I've tinkered, doesn't meen I've mastered!

so I am real new to C, been playing seems ok. I have played with the sketch that just flashes D13, the one that allows me to talk to the DS3232 board etc - all good. So now I would like to just have a sketch that flashes D13 twice, reads the time in(non interactive to the console user) an does a serial print. So I am thinking, just take bits and pieces from the code I have been using, which I tried, but then I got compile errors about variables not being defined, labels unknown etc etc. I think what's confusing me is I don't know what is a C core statement, and what is a function from a .H file etc.

SO.. I went and opened up a .H file (DS3232RTC.h) and then RTC.H etc.. they're pretty full on. I guess what I'm thinking is I don't want to write a full set of code from the ground up, but these .H files - are they documented.. ie at a high level can a dummy like me look for a doco on RS3232RTC.h which tells me how to use it, what syntax to use and what to expect back etc..?

Appols for perhaps stupid question!

please tell me there are some people in the Australian time zone on here :-)

Ian
(Melbourne, AU)
We have a DS3232 tutorial here:
http://www.freetronics.com/pages/rtc-re ... tart-guide