RTC 1307 I2C on Uno R3

OK

I have now spend the hole day trying to do this. I have never programmed before. I have a Uno R3 and a RTC 1307 and I'm going to control sun up and down and moon up and down in my aquarium. I have 4 LED drivers and 2 Laptop PSU's for power. How the hell do I do the programming? I just want to set the time, the start time of the cycles, the cycles, the PWM for the dimmers and read everything on my laptop via the USB cable.

Will someone help me?

I have a Uno R3 and a RTC 1307 and I'm going to control sun up and down and moon up and down in my aquarium.

An RTC can not control when the sun rises or sets. Nor, can it control when the moon rises or sets. It's a clock, after all.

How the hell do I do the programming?

You use the damned IDE and start typing.

I just want to set the time, the start time of the cycles

That is independent of the clock or the hardware the turns the LEDs on or off.

the cycles

What does this mean? The end time? Something that happens between the start time and the end time?

the PWM for the dimmers

So, what part of this are you having trouble with?

and read everything on my laptop via the USB cable.

Well, first you need to have the Arduino WRITE something!

Will someone help me?

How much does this job pay?

hmmm.. that helped...

It can and will control both the sun and the moon in my aquarium.

I don't know what to type.

The tinkering I have made will make it if I can get the code right.

"The cycles" is the 4 colors of LED that will dimm up or down.

the hardware is not a problem, but still, the code to make it is problems...

Again a programming problem.

and it will help you develop a way to understand a non-programming nerd, and last but not least. You will make me and my fish happy.

I have a Uno R3 and a RTC 1307

Do you have the RTC working with the UNO? If not look here : http://learn.adafruit.com/ds1307-real-time-clock-breakout-board-kit/arduino-library OR http://code.google.com/p/ds1307new/

I have got the RTC to work now, after some time. (got a new job 300 kilometers from were I live and have to move)

I’ve got that with:
#include <DS1307RTC.h>
#include <Time.h>
#include <Wire.h>

const char *monthName[12] = {
“Jan”, “Feb”, “Mar”, “Apr”, “May”, “Jun”,
“Jul”, “Aug”, “Sep”, “Oct”, “Nov”, “Dec”
};

tmElements_t tm;

void setup() {
bool parse=false;
bool config=false;

// get the date and time the compiler was run
if (getDate(DATE) && getTime(TIME)) {
parse = true;
// and configure the RTC with this info
if (RTC.write™) {
config = true;
}
}

Serial.begin(9600);
while (!Serial) ; // wait for Arduino Serial Monitor
delay(200);
if (parse && config) {
Serial.print(“DS1307 configured Time=”);
Serial.print(TIME);
Serial.print(", Date=");
Serial.println(DATE);
} else if (parse) {
Serial.println(“DS1307 Communication Error :-{”);
Serial.println(“Please check your circuitry”);
} else {
Serial.print(“Could not parse info from the compiler, Time=”");
Serial.print(TIME);
Serial.print("", Date="");
Serial.print(DATE);
Serial.println(""");
}
}

void loop() {
}

bool getTime(const char *str)
{
int Hour, Min, Sec;

if (sscanf(str, “%d:%d:%d”, &Hour, &Min, &Sec) != 3) return false;
tm.Hour = Hour;
tm.Minute = Min;
tm.Second = Sec;
return true;
}

bool getDate(const char *str)
{
char Month[12];
int Day, Year;
uint8_t monthIndex;

if (sscanf(str, “%s %d %d”, Month, &Day, &Year) != 3) return false;
for (monthIndex = 0; monthIndex < 12; monthIndex++) {
if (strcmp(Month, monthName[monthIndex]) == 0) break;
}
if (monthIndex >= 12) return false;
tm.Day = Day;
tm.Month = monthIndex + 1;
tm.Year = CalendarYrToTm(Year);
return true;
}

I have been looking all over the web and the only other controllers I can find is with LCD displays and lots of buttons.
I just want to control it ones, and then it should work.
much like this without LCD and buttons.

So, now that you know what time it is, you can do any of the time-based things you want to do. What help do you need with that?

Happy fish are tasty fish!