Hello lovely people!
after a pretty long break i recently picked up a new Arduino mega for a project i sort of started 6 months ago.
long story short, i started never finished, life took over and it was a job to pick back up, now that i've jsut finished my Uni exams for a few months i thought i'd have another stab.
firstly the first project can be found here:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1269962097/0
the idea was to build my own little reef computer for a pico tank that i set up, unfortunatly july 10 i had to dismantle my pico as it wasnt getting the attention it needed plus going away on holiday etc ment it was for the best. i restarted the pico last month and with it restarted my interest in Arduinos, so i ordered my bits and bobs and would like to have another stab at the project.
i deciced to buy a second Mega so i could work on different aspects of the project before compiling it with my old (which is a mess of breadboards, wires, probes etc)
so without wasting any more time
Ladys and gentle men if you so choose to help.
I want to write a piece of software which utilizes the buckpucks of my DIY led light and fade my led's in via PWM and my RTC chip.
once ive got the basics sorted, i would like to incorporate a moon light and possibly have some fun with "random" weather patterns etc.
i've had a bit of a dabble this everning just "relearning the ropes" as it were with coding, the last object orientated programing i did was months a go, and with my poor memory unfortunatly some has slipped :
So this is the stage im at so far...
....
yup thats it nothing!
ok not quite,
I hooked up my DIY RTC chip to my arduino and pulled over some test coding and used the sereal monitor to check it all works.
this was only ment to be a 10-15 minute job before starting some more productive coding but for some reason my RTC chip isnt working correctly or atleast my coding.
for some reason my "seconds" wont write properly.
when i call the serial monitor up it always starts from 0. edit while typing this entry i realised i needed to hash out the RTC start program after it had been flashed to the RTC chip now we can move onto the fun bit
heres the given test code:
#include <WProgram.h>
#include <Wire.h>
#include <DS1307.h>
void setup()
{
Serial.begin(9600);
RTC.stop();
RTC.set(DS1307_DOW,5);
RTC.set(DS1307_DATE,21);
RTC.set(DS1307_MTH,1);
RTC.set(DS1307_YR,11);
RTC.set(DS1307_SEC,34);
RTC.set(DS1307_MIN,46);
RTC.set(DS1307_HR,20);
RTC.start();
}
void loop()
{
Serial.print(RTC.get(DS1307_HR,true)); //read the hour and also update all the values by pushing in true
Serial.print(":");
Serial.print(RTC.get(DS1307_MIN,false));//read minutes without update (false)
Serial.print(":");
Serial.print(RTC.get(DS1307_SEC,false));//read seconds
Serial.print(" "); // some space for a more happy life
Serial.print(RTC.get(DS1307_DATE,false));//read date
Serial.print("/");
Serial.print(RTC.get(DS1307_MTH,false));//read month
Serial.print("/");
Serial.print(RTC.get(DS1307_YR,false)); //read year
Serial.println();
delay(1000);
}
How would you guys go about implimenting some form of coding where say
8:00AM = start fading first chain of led's in
8.30AM = start fading in second chain of led's in
8.00PM = start fading second chain of led's out
8.30PM = start fading second chain of leds out.
id like each chain to fade in roughly from 0-100% over the space of say 1hour
would you guys use something like a multi argument IF statement?
if((DS1307_HR == 8)&&(DS1307_MIN = 0){
....
}
i know this consept is far from new nor is the application, yes i have googled and come across a little but i just wanted to compile all my thoughts, code etc into my own thread.
Many thanks in advanced
Luke
P.s.
if anyones interested:
my 4ft x 2ftx 2ft Mixed reef
http://www.ocean-wonders.co.uk/messageboard/showthread.php/7553-Phoenix-s-Reef-V3.0/page18
and my LED driven Pico which this arduino project is for:
http://www.ocean-wonders.co.uk/messageboard/showthread.php/6439-Phoenix-s-Little-Suprise/page16