Guide: Arduino based LED controller for Current Satellite LED+ - Page 24
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 10-23-2013, 04:13 AM   #346
Aquatechtoo
High Tech Redneck
 
Aquatechtoo's Avatar
 
PTrader: (0/0%)
Join Date: Mar 2013
Location: South Central PA
Posts: 48
Default

Guide: Arduino based LED controller for Current Satellite LED+


I'm working from the start of the thread to build this controller and am running into an error with "millis" not being declared in the scope in the Time library when I attempt to verify the code in 1.0.5. Arduino-related forums say to make sure I'm running the latest version of that library, which I am, or that I can replace Wprogram.h with Arduino.h in the TimeAlarms.cpp file. Neither of these suggestions solved the problem like it did for the forum posters so I suspect I'm doing something wrong, procedurally.

However, my question is this: if I'm going to use an RTC instead of the software clock, do I need to worry about this error?
Aquatechtoo is offline   Reply With Quote
Sponsored Links
Advertisement
 
Old 10-23-2013, 06:07 PM   #347
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 645
Default

Try changing the order of the #include commands at the beginning of the sketch. Sometimes that can fix issues with the "not declared" error. You shouldn't have to include Arduino.h since its always included, but it doesn't hurt.

Also, make sure that you've placed the libraries into the user library directory and not into the built-in library directory.



Sent from my HTC One X using Tapatalk
__________________
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 10-24-2013, 03:11 AM   #348
Dahammer
Algae Grower
 
PTrader: (0/0%)
Join Date: Oct 2010
Location: Mississippi
Posts: 118
Default

Which version of this code are you using? Post the exact error you are getting when you compile it.
Dahammer is offline   Reply With Quote
Old 10-24-2013, 02:18 PM   #349
Aquatechtoo
High Tech Redneck
 
Aquatechtoo's Avatar
 
PTrader: (0/0%)
Join Date: Mar 2013
Location: South Central PA
Posts: 48
Default

Upon further review, I'm certain there must be a dumb little detail that is incorrect based on how I'm managing the software, libraries, etc. I switched the order of the libraries being used under Setup in the code several times. Same errors.

I did not realize that the libraries should be placed in the My Documents folder instead of the Libraries folder inside C:/Program Files(x86)/Arduino/Libraries - one of those small details that is good for me to learn. I moved (cut/paste) these 4 libraries (Time, DateTime, TimeAlarm, DateTimeSettings), along with the DS1307RTC library, into the My Documents folder. I ran the sketch, which is saved in the Arduino folder within My Documents, and observed the same resulting errors, attached.

I am using Arduino v1.0.5. The libraries are the newest versions available (to my knowledge) which I got here: http://playground.arduino.cc//Code/Time
The code I'm using is copied from Indychus' post #25 of this thread.
I changed the int IRLedPin from 13 to 3.
I changed the time/date values.
I changed #define dtNBR_ALARMS from 6 to 24.
I have NOT explored the Device ID's in the code yet to see how they compare to my values. I know they are different, but I was going to take that step after clearing up this verification error prior to uploading.
Attached Thumbnails
Click image for larger version

Name:	Lib_error.jpg
Views:	21
Size:	28.7 KB
ID:	226473  

Aquatechtoo is offline   Reply With Quote
Old 10-24-2013, 03:03 PM   #350
mistergreen
No more Bow ties
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 13,947
Default

sounds more like version problem.
replace Wprogram.h" with "Arduino.h in the library
mistergreen is online now   Reply With Quote
Old 10-24-2013, 09:04 PM   #351
Aquatechtoo
High Tech Redneck
 
Aquatechtoo's Avatar
 
PTrader: (0/0%)
Join Date: Mar 2013
Location: South Central PA
Posts: 48
Default

This is what I thought too, but "Wprogram.h" was not found in any library, except "Time.cpp", in the Time library, in which I replaced it with "Arduino.h". It did not clear the error. As I originally mentioned, most of the forums I read pointed to that issue and replacing that in the header file seemed to solve the problem, which is why I can't figure out what I'm doing differently.
Aquatechtoo is offline   Reply With Quote
Old 10-25-2013, 12:08 AM   #352
Aquatechtoo
High Tech Redneck
 
Aquatechtoo's Avatar
 
PTrader: (0/0%)
Join Date: Mar 2013
Location: South Central PA
Posts: 48
Default First Problem Solved?

I started over and manually installed the libraries listed here: http://playground.arduino.cc/Code/Time
I noticed that there is no library listed for DateTime or DateTimeString in the .zip file. However, I was able to compile the code w/o problems. I opened the Serial Monitor and watched it keep track of the time.

When I closed out of the IDE, added the DateTime and DateTimeString libraries in, opened the IDE and compiled the code, I got the errors again.
Aquatechtoo is offline   Reply With Quote
Old 10-25-2013, 12:38 AM   #353
Dahammer
Algae Grower
 
PTrader: (0/0%)
Join Date: Oct 2010
Location: Mississippi
Posts: 118
Default

Quote:
Originally Posted by Aquatechtoo View Post
I started over and manually installed the libraries listed here: http://playground.arduino.cc/Code/Time
I noticed that there is no library listed for DateTime or DateTimeString in the .zip file. However, I was able to compile the code w/o problems. I opened the Serial Monitor and watched it keep track of the time.

When I closed out of the IDE, added the DateTime and DateTimeString libraries in, opened the IDE and compiled the code, I got the errors again.
DateTime & DateTimeString are not used in the code. So just omit them. Best I recall, they were just remnants of some other code.

At any rate the version you have chosen does not support an RTC. That came along later in the development. You'll probably want to switch to one of the later versions to get support for the RTC. Also, at some point (post #148) we switched to using the IRremote library to send the commands and that drastically increased the IR range. There were lots of bugs along the way as well, so I'd probably either use the last one Indy posted or the last one I posted.
Dahammer is offline   Reply With Quote
Old 10-25-2013, 01:45 AM   #354
Aquatechtoo
High Tech Redneck
 
Aquatechtoo's Avatar
 
PTrader: (0/0%)
Join Date: Mar 2013
Location: South Central PA
Posts: 48
Default

Ok, Dahammer, Indy, et. al, thanks for the help so far. Progress is noted. I've been able to trigger the alarms from (7,00,0, Dawn/Dusk) to Full Spec (13,0,0) but I cannot get the lights to step back down at 15,00,0, 19,00,0, or 21,00,0. Any thoughts why that might be?

Dahammer, would you suggest just wiring the controller w/ the RTC (Chronodot 2.1) and LCD (16x2 Blue from Adafruit) and get all the hardware in place in the enclosure straightaway? And then use one of the final pieces of code (v4.X.X) you and Indy posted and troubleshoot from there, instead of adding a piece of hardware along with the corresponding code/libraries for each stop along the way?
Aquatechtoo is offline   Reply With Quote
Old 10-25-2013, 02:20 AM   #355
Dahammer
Algae Grower
 
PTrader: (0/0%)
Join Date: Oct 2010
Location: Mississippi
Posts: 118
Default

Quote:
Originally Posted by Aquatechtoo View Post
Ok, Dahammer, Indy, et. al, thanks for the help so far. Progress is noted. I've been able to trigger the alarms from (7,00,0, Dawn/Dusk) to Full Spec (13,0,0) but I cannot get the lights to step back down at 15,00,0, 19,00,0, or 21,00,0. Any thoughts why that might be?

Dahammer, would you suggest just wiring the controller w/ the RTC (Chronodot 2.1) and LCD (16x2 Blue from Adafruit) and get all the hardware in place in the enclosure straightaway? And then use one of the final pieces of code (v4.X.X) you and Indy posted and troubleshoot from there, instead of adding a piece of hardware along with the corresponding code/libraries for each stop along the way?
I'd add the RTC at least. It doesn't matter about LCD. The later versions of code that support the LCD will work whether or not an LCD is present. Then I'd test each command to make certain that they all work. You can send in commands via the serial terminal with the later versions of the code.

Here is the code I'm currently using. It has been running flawlessly for the last couple of months. It adds support for 2 thermometers, per code developed in this thread. But I do not have any thermometers on mine, therefore I have not tested that portion of this code and they are disabled by default in the code. It is also set up for a 16x2 LCD, since that's what I have on mine. Also notice that I have some of the alarms disabled, so enable them as you see fit.

Code:
///////////////////////////////////////////////////////////////////
// Current Satellite LED+ Controller  V4.1                       //
//   Indychus...Dahammer...mistergreen @ plantedtank.net         //
//   This code is public domain.  Pass it on.                    //
//   Confirmed on Arduino UNO 1.0.5                              //
//   Req. Time, TimeAlarms, RTClib, IRremote                     //
///////////////////////////////////////////////////////////////////
//
// This version uses Ken Shirriff's IRremote library to Rx/Tx the IR codes
// http://www.righto.com/2009/08/multi-protocol-infrared-remote-library.html
// 
// This code does NOT use PIN 13 on the Uno, as do previous versions
// Instead PIN 3, which is a PWM pin, is used. So you'll need to connect
// your LED to PIN 3 instead of PIN 13 for it to work.
//
// You can test the IR commands via the Arduino software's serial monitor
// by sending in a value from 1 - 32. Values follow the remote control, 
// left to right, top to bottom (e.g 1 = Orange, 2 = Blue, 21 = Moon1, etc)
//
// Install LCD per instructions at http://learn.adafruit.com/character-lcds/overview
//
// Added support for 2 Thermometers but it hasn't been tested
//
#include <Wire.h>
#include <RTClib.h>
#include <Time.h>
#include <TimeAlarms.h>
#include <IRremote.h>
#include <LiquidCrystal.h>
#include <OneWire.h>
#include <DallasTemperature.h>

RTC_DS1307 RTC;
IRsend irsend;

#define RANDPIN 0            // This needs to be set to an unused Analog pin, Used by RandomStorm()
static FILE uartout = {0};   // UART FILE structure
static FILE lcdout = {0} ;   // LCD FILE structure

//---------- LCD SETUP
#define LCD_COLS 16      // Number of columns on the LCD (e.g. 16, 20, etc)
#define LCD_ROWS 2       // Number of rows on the LCD (e.g. 2, 4, etc)
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);  // Arduino pins that the LCD is connected too

//---------- THERMOMETER SETUP
//#define ONE_WIRE_BUS 2                // Ardunio pin for thermometer; comment out if you don't have a thermometer
#ifdef ONE_WIRE_BUS
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
DeviceAddress thermometer_1 = { 0x28, 0x98, 0x82, 0xA8, 0x04, 0x00, 0x00, 0x6D }; // You'll need to change to match your sensor
DeviceAddress thermometer_2 = { 0x28, 0xA6, 0x33, 0xA8, 0x04, 0x00, 0x00, 0x11 }; // You'll need to change to match your sensor
#endif

// Current Satellite+ IR Codes (NEC Protocol)
unsigned long codeHeader = 0x20DF; // Always the same
// Remote buttons listed left to right, top to bottom
PROGMEM unsigned int arrCodes[32] = {0x3AC5,  // 1 -  Orange
                                     0xBA45,  // 2 -  Blue
                                     0x827D,  // 3 -  Rose
                                     0x02FD,  // 4 -  Power On/Off
                                     0x1AE5,  // 5 -  White
                                     0x9A65,  // 6 -  FullSpec
                                     0xA25D,  // 7 -  Purple
                                     0x22DD,  // 8 -  Play/Pause
                                     0x2AD5,  // 9 -  Red Up
                                     0xAA55,  // 10 - Green Up
                                     0x926D,  // 11 - Blue Up
                                     0x12ED,  // 12 - White Up
                                     0x0AF5,  // 13 - Red Down
                                     0x8A75,  // 14 - Green Down
                                     0xB24D,  // 15 - Blue Down
                                     0x32CD,  // 16 - White Down
                                     0x38C7,  // 17 - M1 Custom
                                     0xB847,  // 18 - M2 Custom
                                     0x7887,  // 19 - M3 Custom
                                     0xF807,  // 20 - M4 Custom
                                     0x18E7,  // 21 - Moon 1
                                     0x9867,  // 22 - Moon 2
                                     0x58A7,  // 23 - Moon 3
                                     0xD827,  // 24 - Dawn/Dusk
                                     0x28D7,  // 25 - Cloud 1
                                     0xA857,  // 26 - Cloud 2
                                     0x6897,  // 27 - Cloud 3
                                     0xE817,  // 28 - Cloud 4
                                     0x08F7,  // 29 - Storm 1
                                     0x8877,  // 30 - Storm 2
                                     0x48B7,  // 31 - Storm 3
                                     0xC837}; // 32 - Storm 4

// These are the messages that print on the serial monitor & lcd when each IR code is sent
#define MAX_MSG_LEN 13  // Maximum length of the arrMSG messages
prog_char PROGMEM arrMSG[][MAX_MSG_LEN+1] = {"Orange",        "Blue",          "Rose",          "On/Off",
                                             "White",         "Full Spec",     "Purple",        "Play/Pause",
                                             "Red Up",        "Green Up",      "Blue Up",       "White Up",
                                             "Red Down",      "Green Down",    "Blue Down",     "White Down",
                                             "Custom 1",      "Custom 2",      "Custom 3",      "Custom 4",
                                             "Moon 1",        "Moon 2",        "Moon 3",        "Dawn/Dusk",
                                             "Cloud 1",       "Cloud 2",       "Cloud 3",       "Cloud 4",
                                             "Storm 1",       "Storm 2",       "Storm 3",       "Storm 4"};

void SetAlarms()
{
  // Set up your desired alarms here
  // The default value of dtNBR_ALARMS is 6 in TimeAlarms.h.
  // This code sets 9 alarms by default, so you'll need to change dtNBR_ALARMS to 9 or more
  // Changes the times to suit yourself. Add as many alarms as you like, just stay within dtNBR_ALARMS
  Alarm.alarmRepeat(10,00,0, DawnDusk);
  //Alarm.alarmRepeat(7,30,0, Cloud2);     // (HR,MIN,SEC,FUNCTION)
  Alarm.alarmRepeat(11,00,0, FullSpec);
  //Alarm.alarmRepeat(18,00,0, Cloud2);
  Alarm.alarmRepeat(17,00,0, DawnDusk);
  Alarm.alarmRepeat(19,00,0, Moon2);
  
  // Comment these out if you don't want the chance of a random storm each day
  Alarm.alarmRepeat(12,00,00, RandomStorm);
  RandomStorm();  // Sets up intial storm so we don't have wait until alarm time

#ifdef ONE_WIRE_BUS  
  Alarm.timerRepeat(1800, PrintTemp);  // Print temps every 30 minutes
  PrintTemp();                         // Display initial temps
#endif
}

void setup()
{
  Wire.begin();
  RTC.begin();
  Serial.begin(9600);
  lcd.begin(LCD_COLS, LCD_ROWS);

#ifdef ONE_WIRE_BUS
  sensors.begin();   // Start temp sensors
  sensors.setResolution(thermometer_1, 9);  // Set them to 9 bit mode
  sensors.setResolution(thermometer_2, 9);
#endif

  // fill in the UART file descriptor with pointer to writer.
  fdev_setup_stream (&uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE);
  stdout = &uartout;  // Output stdout to UART
   
  // fill in lcd file descriptor (we'll use fprintf to output to it)
  fdev_setup_stream (&lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE);
  
  if (! RTC.isrunning()) {
    // If no RTC is installed, set time to compile time at each reset
    printf_P(PSTR("RTC is NOT running!\n"));  // Store this string in PROGMEM
    RTC.adjust(DateTime(__DATE__, __TIME__));
    }
  
  setSyncProvider(syncProvider);     // reference our syncProvider function instead of RTC_DS1307::get()
  
  printf_P(PSTR("Time: %02d:%02d:%02d\n"), hour(), minute(), second());  // Print the time
  SetAlarms();  // Set up above alarms
  
  // Print available SRAM for debugging, comment out if you want
  printf_P(PSTR("SRAM: %d\n"), freeRam());
  
  printf_P(PSTR("To test IR codes, send 1 - 32\n"));
}

void loop()
{
  if (Serial.available() > 0) {
    delay(5); //Wait for transmission to finish
    TestCodes(SerialReadInt());  // Go grab IR code and send it
  }
  Alarm.delay(100);   // Service alarms & wait (msec)
  lcd.setCursor(0,0);
  fprintf(&lcdout, "%02d:%02d", hour(), minute());  // Print the time HH:MM to the lcd
}

time_t syncProvider()
{
  //this does the same thing as RTC_DS1307::get()
  return RTC.now().unixtime();
}

void RandomStorm ()
{ 
  // Schedules a storm between 1 & 8 in the evening
  // It sets Storm2, followed by Cloud2 or DawnDusk or Moon2, depending on when the storm is over
  randomSeed(analogRead(RANDPIN));        // Generate random seed on unused pin
  byte RH = random(23);                   // Randomizer for RandomStorm
  byte RM = random(59);
  byte RS = random(59);
  byte TSDurationH = random(2);
  byte TSDurationM = random(59);
  
  lcd.setCursor(0,1);
  if (RH >= 13 && RH <= 21)
    { // If 1:00PM - 8:00PM schedule a storm
      Alarm.alarmOnce(RH,RM,RS,Storm2);
      
      // Store strings in PROGMEM
      printf_P(PSTR("Scheduled Storm: %02d:%02d:%02d Duration: %02d:%02d\n"), RH, RM, RS, TSDurationH, TSDurationM);
      fprintf_P(&lcdout, PSTR("Sch Storm: %02d:%02d"), RH, RM);
          
      if ((RH + TSDurationH) < 19)   // Switch to Cloud2 if storm ends between 1:00-6:59pm
        {
          Alarm.alarmOnce((RH + TSDurationH),(RM + TSDurationM),RS,Cloud2);
        }
      else if ((RH + TSDurationH) < 21)  // Switch to DawnDusk if storm ends between 7:00-8:59pm
        {
          Alarm.alarmOnce((RH + TSDurationH),(RM + TSDurationM),RS,DawnDusk);
        }
      else                               // Otherwise, switch to Night2
        {
          Alarm.alarmOnce((RH + TSDurationH),(RM + TSDurationM),RS,Moon2);
        }
    }
    else
    { // Don't really need this, but it can stay till we need the space
      printf_P(PSTR("No storm today\n"));
      fprintf_P(&lcdout, PSTR("No storm today  "));
    }
}

int SerialReadInt()
{
  // Reads first 2 bytes from serial monitor; anything more is tossed
  byte i;
  char inBytes[3];
  char * inBytesPtr = &inBytes[0];  // Pointer to first element
    
    for (i=0; i<2; i++)             // Only want first 2 bytes
      inBytes[i] = Serial.read();
    inBytes[i] =  '\0';             // Put NULL character at the end
    while (Serial.read() >= 0)      // If anything else is there, throw it away
      ; // do nothing      
    return atoi(inBytesPtr);        // Convert to decimal
}

void TestCodes (int cmd)
{
  // Handles commands sent in from the serial monitor
  if (cmd >= 1 && cmd <= 32)
    { 
      // cmd must be 1 - 32
      SendCode(cmd-1, 1);
    }
#ifdef ONE_WIRE_BUS
    else if (cmd == 33)
    {
      PrintTemp();  // Send 33 to test temp sensors
    }
#endif
    else { printf_P(PSTR("Invalid Choice\n")); }
}

void SendCode ( int cmd, byte numTimes )
{ // cmd = the element of the arrCode[] array that holds the IR code to be sent
  // numTimes = number of times to emmit the command
  // Shift header 16 bits to left, fetch code from PROGMEM & add it with bitwise or
  unsigned long irCode = (codeHeader << 16) | pgm_read_word_near(arrCodes + cmd);
  for( byte i = 0; i < numTimes; i++)
  {
    irsend.sendNEC(irCode,32); // Send/emmit code
    delay(100);
  }
  // Print the string associated with the IR code & the time
  //printf("%S: 0x%lx %02d:%02d:%02d\n", arrMSG[cmd], irCode, hour(), minute(), second());
  printf("%S: %02d:%02d:%02d\n", arrMSG[cmd], hour(), minute(), second());

  lcd.setCursor(6,0);
  fprintf(&lcdout, "%-10S", arrMSG[cmd]);
}

int freeRam ()
{
  // Returns available SRAM
  extern int __heap_start, *__brkval; 
  int v; 
  return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); 
}

// Output function for stdout redirect
static int uart_putchar (char c, FILE *stream)
{
  // Serial write fumction
  Serial.write(c);
  return 0;
}

// Output function for lcd output
static int lcd_putchar(char ch, FILE* stream)
{
  // lcd write function
  lcd.write(ch);
  return (0);
}

#ifdef ONE_WIRE_BUS
void PrintTemp()
{
  float tempC = sensors.getTempC(thermometer_1);
  lcd.setCursor(0,2);
  lcd.print("Tank 1: ");
  lcd.print(DallasTemperature::toFahrenheit(tempC), 1);
  lcd.print((char)223);
  
  tempC = sensors.getTempC(thermometer_2);
  lcd.setCursor(0,3);
  lcd.print("Tank 2: ");
  lcd.print(DallasTemperature::toFahrenheit(tempC), 1);
  lcd.print((char)223);
}
#endif

// IR Code functions, called by alarms
void Orange() {SendCode(0,2);}
void Blue() {SendCode(1,2);}
void Rose() {SendCode(2,2);}
void PowerOnOff() {SendCode(3,1);}
void White() {SendCode(4,2);}
void FullSpec() {SendCode(5,2);}
void Purple() {SendCode(6,2);}
void Play() {SendCode(7,1);}
void RedUp() {SendCode(8,1);}
void GreenUp() {SendCode(9,1);}
void BlueUp() {SendCode(10,1);}
void WhiteUp() {SendCode(11,1);}
void RedDown() {SendCode(12,1);}
void GreenDown() {SendCode(13,1);}
void BlueDown() {SendCode(14,1);}
void WhiteDown() {SendCode(15,1);}
void M1Custom() {SendCode(16,2);}
void M2Custom() {SendCode(17,2);}
void M3Custom() {SendCode(18,2);}
void M4Custom() {SendCode(19,2);}
void Moon1() {SendCode(20,2);}
void Moon2() {SendCode(21,2);}
void Moon3() {SendCode(22,2);}
void DawnDusk() {SendCode(23,2);}
void Cloud1() {SendCode(24,2);}
void Cloud2() {SendCode(25,2);}
void Cloud3() {SendCode(26,2);}
void Cloud4() {SendCode(27,2);}
void Storm1() {SendCode(28,2);}
void Storm2() {SendCode(29,2);}
void Storm3() {SendCode(30,2);}
void Storm4() {SendCode(31,2);}
Dahammer is offline   Reply With Quote
Old 10-25-2013, 02:37 AM   #356
Aquatechtoo
High Tech Redneck
 
Aquatechtoo's Avatar
 
PTrader: (0/0%)
Join Date: Mar 2013
Location: South Central PA
Posts: 48
Default

Thank you very much for your recommendations and sharing your code. I will get to work on this in the coming days/week and report back with celebrations and challenges.
Aquatechtoo is offline   Reply With Quote
Old 10-25-2013, 03:25 AM   #357
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 645
Default

Did you change the number of alarms in the TimeAlarms.h file? See post 25. That could explain why only half of your alarms are working.

Sent from my HTC One X using Tapatalk
__________________
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 10-25-2013, 03:56 AM   #358
Aquatechtoo
High Tech Redneck
 
Aquatechtoo's Avatar
 
PTrader: (0/0%)
Join Date: Mar 2013
Location: South Central PA
Posts: 48
Default

Good call, Indy. 13,00,1 would be the 6th alarm, I believe. I had changed it to 24 yesterday, but I'm now wondering if I forgot to go back to that file since I wiped the libraries out and started over tonight. I'll check that tomorrow.
Aquatechtoo is offline   Reply With Quote
Old 10-25-2013, 12:56 PM   #359
Christophe
Algae Grower
 
PTrader: (0/0%)
Join Date: Oct 2013
Location: Albuquerque
Posts: 49
Default

Just saw this thread, cool work! I just set up my own Arduino controller for Current Satellite LED+ last week. I'm a software engineer by trade, so it's been pretty quick & easy.

For a long time I noticed how much fish jump when lights kick on/off if they're just on a timer. I was mostly interested in natural, slow transitions from lights off to full on and back over the course of the day, and in controlling photoperiod for plants. The LED+ has been great for that on my moderately planted, no CO2 40g breeder, but I hate having to manually mess with it via the remote control. I'm also a little leery of the fact that that wispy little remote is the only way to control it.

My program uses a couple of sine functions to control the light levels, one for RGB, and one for the white lights. They're fed time from a DS1307 RTC. The user provides lights-on time, lights-off time, and amplitude, which controls both how quickly it ramps, and the percentage of the photoperiod spent at full on. It's also tunable to provide multiple photoperiods in a day, though I don't see much reason to do more than two per day.

I'll keep watching this thread, let me know if there's something I can contribute!
Christophe is offline   Reply With Quote
Old 11-12-2013, 04:12 AM   #360
Aquatechtoo
High Tech Redneck
 
Aquatechtoo's Avatar
 
PTrader: (0/0%)
Join Date: Mar 2013
Location: South Central PA
Posts: 48
Default LCD Issue

After much wrestling with the ChronoDot RTC, I was able to finally isolate the compatibility issue thanks to the good folks in the Adafruit forums. I have the LCD wired up but it isn't displaying any output. I double checked the wiring from the tutorial Indy suggested: http://learn.adafruit.com/character-...-character-lcd but I'm not getting a reading from the LED controller code or from the example sketch in the LCD library. I'm wondering if this could be related to the fact that I didn't solder the headers onto the display yet? I want to prove that things are wired up and working correctly before making permanent connections and installing the boards in a chassis. For what its worth, the display lights up and the potentiometer is working so the contrast and brightness must be fine. I'm just not getting any print out on the display.

I'm using a 16x2 display and Dahammer's code, above.
Aquatechtoo 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 07:53 AM.


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