Guide: Arduino based LED controller for Current Satellite LED+ - Page 5
Planted Tank Forums
Your Tanks Image Hosting *Tank Tracker * Plant Profiles Fish Profiles Planted Tank Guide Photo Gallery Articles

Go Back   The Planted Tank Forum > Specific Aspects of a Planted Tank > DIY


Reply
 
Thread Tools Display Modes
Old 07-28-2013, 03:07 AM   #61
mistergreen
No more Bow ties
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 14,140
Default

I'll write up a quick tut on how to write libraries tomorrow when I get the chance.


Sent from my iPad using Tapatalk HD
mistergreen is offline   Reply With Quote
Sponsored Links
Advertisement
 
Old 07-28-2013, 07:04 AM   #62
Dahammer
Algae Grower
 
PTrader: (0/0%)
Join Date: Oct 2010
Location: Mississippi
Posts: 118
Default

I noticed some errors and edited my previous post.
Dahammer is offline   Reply With Quote
Old 07-28-2013, 04:53 PM   #63
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 645
Default

Wow! You guys are a tremendous help. I will be able to merge your code into mine and test it tomorrow when I get home.

In the meantime, here's some output that my PC at home just emailed me:

RH = 17
RH = 8
11:59:00
12:14:00
12:29:00
12:44:00
12:59:00
Full Spectrum Mode Initialized
Full Spectrum Mode Initialized
13:14:00
13:29:00
13:44:00
13:59:00
14:14:00
14:29:00
14:44:00
14:59:00
Cloud Cover 2 Mode Initialized
Cloud Cover 2 Mode Initialized
15:14:00
15:29:00
15:44:00
15:59:00
16:14:00
16:29:00
16:44:00
16:59:00
Storm2 Mode Initialized
17:14:00
17:29:00
17:44:00
17:59:00
Cloud Cover 2 Mode Initialized
Dawn/Dusk Mode Initialized
18:14:00
18:29:00
18:44:00
18:59:00
Dawn/Dusk Mode Initialized
Dawn/Dusk Mode Initialized
19:14:00
19:29:00
19:44:00
19:59:00
20:14:00
20:29:00
20:44:00
20:59:00
Night 2 Mode Initialized
Night 2 Mode Initialized
21:14:00
21:29:00
21:44:00
21:59:00
...
...
5:59:00
6:14:00
6:29:00
6:44:00
6:59:00
Dawn/Dusk Mode Initialized
Dawn/Dusk Mode Initialized
7:14:00
7:29:00
7:44:00
7:59:00
8:14:00
8:29:00
8:44:00
8:59:00
Cloud Cover 2 Mode Initialized
Cloud Cover 2 Mode Initialized
9:14:00
9:29:00
9:44:00
9:59:00
...
...
12:14:00
12:29:00
12:44:00

You can see that it triggered a successful storm yesterday a little after 5 pm, then recovered and continued into normal operation again. It did fire the cloud2 and dawn/dusk modes after the storm backwards for some reason; I'll troubleshoot that tonight.
__________________
The Fraternity of Dirt
Check out my open-source Arduino-Powered Light Controller Guide for Current LED+ and other IR switchable lights.
Indychus is offline   Reply With Quote
Old 07-28-2013, 06:19 PM   #64
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 645
Default

I'll look into the reset function issue you point out as well... It did reset this morning, but it was only after a storm (RH >12).

Sent from my HTC One X
__________________
The Fraternity of Dirt
Check out my open-source Arduino-Powered Light Controller Guide for Current LED+ and other IR switchable lights.
Indychus is offline   Reply With Quote
Old 07-28-2013, 06:42 PM   #65
Dahammer
Algae Grower
 
PTrader: (0/0%)
Join Date: Oct 2010
Location: Mississippi
Posts: 118
Default

Yeah, I think there are issues with the thunderstorm code. The reason it fired backwards is probably here:
Code:
  if (12 < (RH + (TSDuration/3600000)) < 19) 
  {Alarm.alarmOnce((RH + (TSDuration/3600000) + (RecoveryDelay/3600000)),Cloud2);}
  
  if (12 <= (RH + (TSDuration/3600000)) < 21)
  {Alarm.alarmOnce((RH + (TSDuration/3600000)),DawnDusk);}
First, I don't think this works as you are intending. RH has to be greater than 12 to reach the above code. Both of the expressions are always TRUE. First it compares 12 to ((RH + (TSDuration/3600000)), which is going to be true otherwise we wouldn't be executing this code. TRUE becomes a 1 and then 1 is less than 19 & 21, so that's also true, so it sets both alarms.

The reason they went in reverse is because RecoveryDelay is added to alarm on the for the clouds. I'm not sure I understand exactly are you wanting to do here.

Could also use a toggle switch to turn on/off features like the thunderstorm feature. That would be neat.
Dahammer is offline   Reply With Quote
Old 07-28-2013, 06:57 PM   #66
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 645
Default

I'm trying to get it to always do dawn/dusk for a random time after the storm, then return to the previous mode... cloud2 before 19.00 and night2 after 21.00. from 19.00 to 21.00 it would just stay in dawn/dusk.

**Edited code in above post
__________________
The Fraternity of Dirt
Check out my open-source Arduino-Powered Light Controller Guide for Current LED+ and other IR switchable lights.
Indychus is offline   Reply With Quote
Old 07-28-2013, 07:14 PM   #67
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 645
Default

Ok, edited it once again... it seems to be working right (it compiles and schedules a random storm)... since it's only psuedo-random I get an RH of 17 again to start with. Still not sure about scheduling the dawndusk and cloud2 when (RH + TSDuration) is between 19 and 21. If I manually set RH to any value outside of this range it seems to work as intended. See what you think.
__________________
The Fraternity of Dirt
Check out my open-source Arduino-Powered Light Controller Guide for Current LED+ and other IR switchable lights.
Indychus is offline   Reply With Quote
Old 07-28-2013, 07:47 PM   #68
Dahammer
Algae Grower
 
PTrader: (0/0%)
Join Date: Oct 2010
Location: Mississippi
Posts: 118
Default

Setting the storm time variables to global variables isn't really doing anything. alarmOnce uses the values you call it with to schedule an alarm. Changing those values after the call isn't going to have any effect on the scheduled alarm.

As is, you should only get 1 storm (if that) and then never see it again. This is because the setup() code is only ran once, only at startup, so your call to it in setup() never happens again after the Ardunio starts up. You could just add an alarmRepeat call to storm() in setup so it's called every day. Then you'd get a chance for a storm every day. If you don't want a chance of storm every day, then you can use dowDayofweek in your call to alarmRepeat to only do it on certain days, like dowSaturday for Saturdays and etc.
Dahammer is offline   Reply With Quote
Old 07-28-2013, 08:06 PM   #69
Dahammer
Algae Grower
 
PTrader: (0/0%)
Join Date: Oct 2010
Location: Mississippi
Posts: 118
Default

Quote:
Originally Posted by Indychus View Post
Ok, edited it once again... it seems to be working right (it compiles and schedules a random storm)... since it's only psuedo-random I get an RH of 17 again to start with. Still not sure about scheduling the dawndusk and cloud2 when (RH + TSDuration) is between 19 and 21. If I manually set RH to any value outside of this range it seems to work as intended. See what you think.
I think I see what you are trying to do. You want the storms to last for 0-3 hours and always be followed up by clouds if the time is between 13 & 19. If it's between 19 & 21, you want the storm followed by dawndusk. If it's after 21, you want it followed by night. This correct?
Dahammer is offline   Reply With Quote
Old 07-28-2013, 09:05 PM   #70
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 645
Default

Quote:
Originally Posted by Dahammer View Post
I think I see what you are trying to do. You want the storms to last for 0-3 hours and always be followed up by clouds if the time is between 13 & 19. If it's between 19 & 21, you want the storm followed by dawndusk. If it's after 21, you want it followed by night. This correct?
Right. I added the random storm variables to the global variables just for the first time... after the first storm, it should always use the variables from the reset function. I need to call storm at the end of reset i think....
__________________
The Fraternity of Dirt
Check out my open-source Arduino-Powered Light Controller Guide for Current LED+ and other IR switchable lights.
Indychus is offline   Reply With Quote
Old 07-28-2013, 09:07 PM   #71
mistergreen
No more Bow ties
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 14,140
Default

When you need things to happen in sequence it's good to use a 'finite state machine' coding method. It's basically, 'switches' to turn things on & off.

You can use 'if/then' conditions but easier to see/read with 'switch/case'.

It'll look something like this

Code:
void loop()
{
  static int state = 1; // initial state is 1, the "idle" state.
  static unsigned long ts;  // To store the "current" time in for delays.

  switch(state)
  {
    case 1:
      // We don't need to do anything here, waiting for a forced state change.
      break;
    case 2:
      // turn on storm
      ts = millis();  // Remember the current time
      state = 3;  // Move to the next state
      break;
    case 3:
      // If 19 seconds has passed, then move on to the next state.
      if(millis() > ts + 19000)
      {
        state = 4;
      }
      break;
    case 4:
       //turn on dawn - randomly or not. You can use a random function
      // like 
      // if(random(4) == 1) callDawnFunction
       break;
    default:
      state = 1;
      break;
   }
}
mistergreen is offline   Reply With Quote
Old 07-28-2013, 09:09 PM   #72
Dahammer
Algae Grower
 
PTrader: (0/0%)
Join Date: Oct 2010
Location: Mississippi
Posts: 118
Default

Try this, less the RTC code. I also eliminated the reset function and globals to store the times in.

Code:
void setup()               
{ 
  pinMode(IRledPin, OUTPUT);         // Designate IRledPin as Output
  Serial.begin(9600);                // Connect @ (Baud)    
  Wire.begin();
  RTC.begin();
  
  if (! RTC.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    RTC.adjust(DateTime(__DATE__, __TIME__));
  }
  setSyncProvider(syncProvider);     //reference our syncProvider function instead of RTC_DS1307::get()

////////////ALARM FUNCTIONS/////////////////////////////////////////
  Alarm.alarmRepeat(7,00,0, DawnDusk);
  Alarm.alarmRepeat(7,00,1, DawnDusk);
  Alarm.alarmRepeat(9,00,0, Cloud2);     // (HR,MIN,SEC,FUNCTION)
  Alarm.alarmRepeat(9,00,1, Cloud2);
  Alarm.alarmRepeat(11,00,0, FullSpec);
  Alarm.alarmRepeat(11,00,1, FullSpec);
  Alarm.alarmRepeat(15,00,0, Cloud2);
  Alarm.alarmRepeat(15,00,1, Cloud2);
  Alarm.alarmRepeat(19,00,0, DawnDusk);
  Alarm.alarmRepeat(19,00,1, DawnDusk);
  Alarm.alarmRepeat(21,00,0, Night2);
  Alarm.alarmRepeat(21,00,1, Night2);
  Alarm.alarmRepeat(0,0,0, ThunderStorm);

  ThunderStorm(); // Schedule the first storm
  
}

void ThunderStorm ()
{
  // Called everyday at midnight & randomly schedules a storm between 1 & 9 in the evening
  unsigned long RH = random(0,23);                   // Randomizer for thunderstorm
  unsigned long RM = random(0,59);
  unsigned long RS = random(0,59);
  unsigned long TSDuration = random(0,10800);     // Random T-Storm duration from 0-3hr
  unsigned long RecoveryDelay = random(0,3600);   // Random after storm gloominess from 0-1hr
  
  Serial.print("RH = ");
  Serial.print(RH);
  Serial.println();
      
  if (RH > 12)                             // If random value is after 1 pm, allow storm
    {
      Alarm.alarmOnce(RH,RM,RS,Storm2);
      if ((RH + (TSDuration/3600)) < 19) {
        // If storm is between 1 & 7, follow with clouds
        Alarm.alarmOnce((RH + (TSDuration/3600)),RM,RS,Cloud2);
      }
      else if ((RH + (TSDuration/3600)) < 21) {
        // If storm is between 7 & 9, follow with dawndusk
        Alarm.alarmOnce((RH + (TSDuration/3600)),RM,RS,DawnDusk);
        }
      else {
        Alarm.alarmOnce((RH + (TSDuration/3600)),RM,RS,Night2);
      }
    }
}

Last edited by Dahammer; 07-28-2013 at 09:26 PM.. Reason: Edited an error in the code & typo
Dahammer is offline   Reply With Quote
Old 07-28-2013, 09:15 PM   #73
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 645
Default

Quote:
Originally Posted by Dahammer View Post
Try this, less the RTC code.

Code:
void setup()               
{ 
  pinMode(IRledPin, OUTPUT);         // Designate IRledPin as Output
  Serial.begin(9600);                // Connect @ (Baud)    
  Wire.begin();
  RTC.begin();
  
  if (! RTC.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    RTC.adjust(DateTime(__DATE__, __TIME__));
  }
  setSyncProvider(syncProvider);     //reference our syncProvider function instead of RTC_DS1307::get()

////////////ALARM FUNCTIONS/////////////////////////////////////////
  Alarm.alarmRepeat(7,00,0, DawnDusk);
  Alarm.alarmRepeat(7,00,1, DawnDusk);
  Alarm.alarmRepeat(9,00,0, Cloud2);     // (HR,MIN,SEC,FUNCTION)
  Alarm.alarmRepeat(9,00,1, Cloud2);
  Alarm.alarmRepeat(11,00,0, FullSpec);
  Alarm.alarmRepeat(11,00,1, FullSpec);
  Alarm.alarmRepeat(15,00,0, Cloud2);
  Alarm.alarmRepeat(15,00,1, Cloud2);
  Alarm.alarmRepeat(19,00,0, DawnDusk);
  Alarm.alarmRepeat(19,00,1, DawnDusk);
  Alarm.alarmRepeat(21,00,0, Night2);
  Alarm.alarmRepeat(21,00,1, Night2);
  Alarm.alarmRepeat(0,0,0, ThunderStorm);
  
}

void ThunderStorm ()
{
  // Called everyday at midnight & randomly schedules a storm between 1 & 9 in the evening
  unsigned long RH = random(0,23);                   // Randomizer for thunderstorm
  unsigned long RM = random(0,59);
  unsigned long RS = random(0,59);
  unsigned long TSDuration = random(0,10800);     // Random T-Storm duration from 0-3hr
  unsigned long RecoveryDelay = random(0,3600);   // Random after storm gloominess from 0-1hr
  
  Serial.print("RH = ");
  Serial.print(RH);
  Serial.println();
      
  if (RH > 12)                             // If random value is after 1 pm, allow storm
    {
      Alarm.alarmOnce(RH,RM,RS,Storm2);
      if ((RH + (TSDuration/3600)) < 19) {
        // If storm is between 1 & 7
        Alarm.alarmOnce((RH + (TSDuration/3600)),RM,RS,Cloud2);
      }
      else if ((RH + (TSDuration/3600)) < 21) {
        // If storm is between 1 & 9
        Alarm.alarmOnce((RH + (TSDuration/3600)),RM,RS,DawnDusk);
        }
      else {
        Alarm.alarmOnce((RH + (TSDuration/3600)),RM,RS,Night2);
      }
    }
}
Ok, yeah... that looks like it's doing the same thing I was trying to do, just much simpler. I was trying to do an approach like mistergreen posted above based on cases and using the millis(), but couldn't get it to compile... I got so deep into it that by the time I went back to if/then I couldn't see the forest for the trees haha.

Just uploaded it to the Uno, we'll see how it does...
__________________
The Fraternity of Dirt
Check out my open-source Arduino-Powered Light Controller Guide for Current LED+ and other IR switchable lights.
Indychus is offline   Reply With Quote
Old 07-28-2013, 09:22 PM   #74
Dahammer
Algae Grower
 
PTrader: (0/0%)
Join Date: Oct 2010
Location: Mississippi
Posts: 118
Default

Quote:
Originally Posted by Indychus View Post
Ok, yeah... that looks like it's doing the same thing I was trying to do, just much simpler. I was trying to do an approach like mistergreen posted above based on cases and using the millis(), but couldn't get it to compile... I got so deep into it that by the time I went back to if/then I couldn't see the forest for the trees haha.

Just uploaded it to the Uno, we'll see how it does...
Notice I added the first call to ThunderStorm() after you saw the code. You too quick. Haha. I left it out previously, so if you don't add it, it will be midnight before the first one is scheduled.
Dahammer is offline   Reply With Quote
Old 07-28-2013, 09:50 PM   #75
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 645
Default

Ok, here we go... This is definitely working, but I want to let it run for a few days before calling it good. Also, I'm gonna go back through the thread and delete some of my failed attempts to clean it up in case anyone else is trying to make sense of my mess haha.

Code:
///////////////////////////////////////////////////////////////////
// Current Satellite LED+ Controller  V2.0 Beta                  //
//   Indychus...Dahammer...mistergreen @ plantedtank.net         //
//   This code is public domain.  Pass it on.                    //
//   Confirmed on Arduino UNO 1.0.5                              //
//   Req. Time, TimeAlarms, DateTime, DateTimeStrings libraries  //
///////////////////////////////////////////////////////////////////

////////////SETUP//////////////////////////////////////////////////
#include <Time.h>
#include <TimeAlarms.h>
#include <DateTime.h>
#include <DateTimeStrings.h>

int IRledPin =  13;                  // Pin location for IR output

void setup()               
{ pinMode(IRledPin, OUTPUT);         // Designate IRledPin as Output
  Serial.begin(9600);                // Connect @ (Baud)
  setTime(18,24,15,7,26,13);          // set time (HR,MIN,SEC,MO,DAY,YR)

  ////////////ALARM FUNCTIONS/////////////////////////////////////////
 
  ThunderStorm ();
 
  Alarm.alarmRepeat(7,00,0, DawnDusk);
  Alarm.alarmRepeat(7,00,0, DawnDusk);
  Alarm.alarmRepeat(9,00,0, Cloud2);     // (HR,MIN,SEC,FUNCTION)
  Alarm.alarmRepeat(9,00,0, Cloud2);
  Alarm.alarmRepeat(13,00,0, FullSpec);
  Alarm.alarmRepeat(13,00,0, FullSpec);
  Alarm.alarmRepeat(15,00,0, Cloud2);
  Alarm.alarmRepeat(15,00,0, Cloud2);
  Alarm.alarmRepeat(19,00,0, DawnDusk);
  Alarm.alarmRepeat(19,00,0, DawnDusk);
  Alarm.alarmRepeat(21,00,0, Night2);
  Alarm.alarmRepeat(21,00,0, Night2);
  Alarm.alarmRepeat(00,00,00, ThunderStorm); 
}   
////////////THUNDERSTORMS///////////////////////////////////////////// 
void ThunderStorm ()
{ // Called everyday at midnight & randomly schedules a storm between 1 & 9 in the evening
  unsigned long RH = random(0,23);                   // Randomizer for thunderstorm
  unsigned long RM = random(0,59);
  unsigned long RS = random(0,59);
  unsigned long TSDuration = random(0,10800);     // Random T-Storm duration from 0-3hr

  Serial.print("Storm = ");
  Serial.print(RH);
  Serial.print(".");
  Serial.print(RM);
  Serial.print(".");
  Serial.print(RS);
  Serial.println();

  if (RH > 12)                             // If random value is after 1 pm, allow storm
      {Alarm.alarmOnce(RH,RM,RS,Storm2);
      
      if ((RH + (TSDuration/3600)) < 19)   // Return to Cloud2 if storm ends between 1-7pm
        {Alarm.alarmOnce((RH + (TSDuration/3600)),RM,RS,Cloud2);}
      
      else if ((RH + (TSDuration/3600)) < 21)  // Return to DawnDusk if storm ends between 7-9pm
        {Alarm.alarmOnce((RH + (TSDuration/3600)),RM,RS,DawnDusk);}
      
      else                                       // Return to Night2 if storm ends after 9pm
        {Alarm.alarmOnce((RH + (TSDuration/3600)),RM,RS,Night2);}}}   


////////////CLOCK///////////////////////////////////////////////////
void  loop(){                       
  digitalClockDisplay();
  Alarm.delay(1000);               // Clock display update frequency (msec)
}

void digitalClockDisplay()          // Digital clock
{ 
  Serial.print(hour());
  printDigits(minute());
  printDigits(second());
  Serial.println(); 
}

void printDigits(int digits)        // Add :
{
  Serial.print(":");
  if(digits < 10)
    Serial.print('0');
  Serial.print(digits);
}


////////////SIGNAL///////////////////////////////////////////////////
// Create Frequency (38khz/26msec)
void pulseIR(long microsecs) 
{  
  cli();                           // kill interupts
  while (microsecs > 0)
  {  
    digitalWrite(IRledPin, HIGH);    // ~3 msec
    delayMicroseconds(7);            // ~delay
    digitalWrite(IRledPin, LOW);     // ~3 msec
    delayMicroseconds(7);            // ~delay
    microsecs -= 26;  
  }
  sei();  
}                           // zombie interupts


////////////FIXTURE FUNCTIONS////////////////////////////////////////
void DeviceID ()
{
  int codes[17][2] = { 
    {8840,4320}, 
    {620,480}, 
    {600,500}, 
    {540,1660}, 
    {580,520}, 
    {520,560}, 
    {600,480},
    {620,480}, 
    {540,540}, 
    {620,1600}, 
    {520,1660}, 
    {580,520},
    {520,1660}, 
    {600,1580}, 
    {620,1580}, 
    {540,1660}, 
    {600,1580}};

  for( int i = 0 ; i < 17; i++) {
    pulseIR(codes[i][0]);
    delayMicroseconds(codes[i][1]);}}

void Footer ()
{int codes[3][2] = { 
    {580,1620},
    {540,38980},
    {8860,2120}};

  for( int i = 0 ; i < 3; i++) {
    pulseIR(codes[i][0]);
    delayMicroseconds(codes[i][1]);}
  pulseIR(620);}

void IR(int codes[15][2]) 
{DeviceID();

  for( int i = 0 ; i < 15; i++) {
    pulseIR(codes[i][0]);
    delayMicroseconds(codes[i][1]);}  
  Footer(); }

void PowerButton()                             //Fixture power on/off toggle
{int codes[15][2] = { 
    {600,500},
    {600,500},
    {520,560},
    {600,500},
    {600,500},
    {520,560},
    {580,1620},
    {540,540},
    {600,1600},
    {520,1660},
    {580,1620},
    {580,1620},
    {520,1660},
    {580,1600},
    {580,520}}; 

  Serial.println("Power Toggle");
  IR(codes);}

void Night2()                                   //Fixture Initialize Night2 Mode
{int codes[15][2] = { 
    {600,1640},
    {600,500},
    {520,560},
    {600,1620},
    {600,1640},
    {520,560},
    {580,540},
    {540,540},
    {600,480},
    {520,1660},
    {580,1620},
    {580,500},
    {520,500},
    {580,1600},
    {580,1560}}; 

  Serial.println("Night 2 Mode Initialized");
  IR(codes);}

void Cloud2()                                         //Fixture Initialize Cloud2 Mode
{int codes[15][2] = { 
    {600,1580},
    {600,500},
    {520,1620},
    {600,500},
    {600,1600},
    {520,560},
    {580,480},
    {540,540},
    {600,560},
    {520,1660},
    {580,560},
    {580,1620},
    {520,560},
    {580,1600},
    {580,1640}};

  Serial.println("Cloud Cover 2 Mode Initialized");
  IR(codes);}

void FullSpec()                                  //Fixture Initialize Full Spectrum Mode
{int codes[15][2] = { 
    {600,1580},
    {600,500},
    {520,480},
    {600,1580},
    {600,1600},
    {520,560},
    {580,1600},
    {540,540},
    {600,560},
    {520,1660},
    {580,1580},
    {580,540},
    {520,560},
    {580,1600},
    {580,480}};

  Serial.println("Full Spectrum Mode Initialized");
  IR(codes);}

void DawnDusk()                         // Fixture Initialize Dawn/Dusk Mode
{int codes[15][2] = { 
    {600,1660},
    {600,1560},
    {520,480},
    {600,1580},
    {600,1600},
    {520,560},
    {580,500},
    {540,540},
    {600,560},
    {520,500},
    {580,1580},
    {580,540},
    {520,560},
    {580,1660},
    {580,1580}};

  Serial.println("Dawn/Dusk Mode Initialized");
  IR(codes);}

void Storm2()                         //Fixture Initialize Storm2 Mode
{  int codes[15][2] = { 
    {600,1660},
    {600,540},
    {520,480},
    {600,500}, 
    {600,1600},
    {520,560},
    {580,500},
    {540,540},
    {600,560},
    {520,1660},
    {580,1580},
    {580,1620},
    {520,560},
    {580,1660},
    {580,1580}};

  Serial.println("Storm2 Mode Initialized");
  IR(codes);}
__________________
The Fraternity of Dirt
Check out my open-source Arduino-Powered Light Controller Guide for Current LED+ and other IR switchable lights.

Last edited by Indychus; 07-28-2013 at 10:24 PM.. Reason: edit
Indychus is offline   Reply With Quote
Reply

Tags
arduino, automation, current led+, diy, light controller

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:24 PM.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright Planted Tank LLC 2012