micos_1972
New member
Looks well got it booked marked, I built one using the nokia 3310 shield but currently altering the code to use a 2.4" tft colour touch screen
![]()
![]()
![]()
![]()
![]()
![]()
Going to use 6 x 50w leds on a 60x30x30
but this is the krusduino projet?
Looks well got it booked marked, I built one using the nokia 3310 shield but currently altering the code to use a 2.4" tft colour touch screen
![]()
![]()
![]()
![]()
![]()
![]()
Going to use 6 x 50w leds on a 60x30x30
nope I am using the due... one that I cant spell lol
dude where can I buy that screen??????????? I will give it a shot lol and yes the firmware can be used on a mega you just have to make sure the pinouts are the same and if not just edit the pin section of the code.
Ok guys I found a coupon code for $1.99 domain so I set up a site at http://www.reefledcontroller.com it has my sketches some info and files and I am working on a full build site within a few days.
/*-------------------------------------------------------------------------------Lunar Phase--------------------------------------------------------------------------------*/
float GetPhase(int nYear, int nMonth, int nDay) // calculate the current phase of the moon
{
float phase;
double AG, IP;
long YY, MM, K1, K2, K3, JD;
YY = nYear - floor((12 - nMonth) / 10);
MM = nMonth + 9;
if (MM >= 12)
{
MM = MM - 12;
}
K1 = floor(365.25 * (YY + 4712));
K2 = floor(30.6 * MM + 0.5);
K3 = floor(floor((YY / 100) + 49) * 0.75) - 38;
JD = K1 + K2 + nDay + 59;
if (JD > 2299160)
{
JD = JD - K3;
}
IP = MyNormalize((JD - 2451550.1) / 29.530588853);
AG = IP*29.53;
phase = 0;
if ((AG < 1.84566) && (phase == 0))
{
phase = 0; //new; 0% illuminated
}
if ((AG < 5.53699) && (phase == 0))
{
phase = .25; //Waxing crescent; 25% illuminated
}
if ((AG < 9.922831) && (phase == 0))
{
phase = .50; //First quarter; 50% illuminated
}
if ((AG < 12.91963) && (phase == 0))
{
phase = .75; //Waxing gibbous; 75% illuminated
}
if ((AG < 16.61096) && (phase == 0))
{
phase = 1; //Full; 100% illuminated
}
if ((AG < 20.30228) && (phase == 0))
{
phase = .75; //Waning gibbous; 75% illuminated
}
if ((AG < 23.99361) && (phase == 0))
{
phase = .50; //Last quarter; 50% illuminated
}
if ((AG < 27.68493) && (phase == 0))
{
phase = .25; //Waning crescent; 25% illuminated
}
if (phase == 0)
{
phase = 0; //default to new; 0% illuminated
}
return phase;
}
double MyNormalize(double v)
{
v = v - floor(v);
if (v < 0)
v = v + 1;
return v;
}
/*||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| S E T U P - D I S P L A Y |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/
byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;
Wire.begin();
// Change these values to what you want to set your clock to.
// You probably only want to set your clock once and then remove
// the setDateDs1307 call.
second = 00;
minute = 15;
hour = 23;
dayOfWeek = 25; // Sunday is 0
dayOfMonth = 4;
month = 4;
year = 11;
//Use the next line for setting the clock
//setDateDs1307(second, minute, hour, dayOfWeek, dayOfMonth, month, year);