Hi,Hey Steve, I just read through a post about an Arduino led controller that you said you built and it working. I have Marsaqua lights and just want to ramp them up and down. Everything seems complicated by people wanting to control more. What does your build consist of?
You should look at Jarduino, touch screen controller easily added to for other control and monitoringWOW! I can't believe it's been 3 years since I've logged into the forum! I built a Typhon 1.0 and it's still going strong 3+ years later, and never even put it in a housing. My LED array needs an overhaul, but the controller is still running like new. Still haven't converted my freshwater tank to salt yet, but it may be happening soon now that I bought my own house and have gotten moved. Happy to see this is still evolving. I bet that's plenty for me to catch up on!
Hello sirOk, I made a google code site to hold the project and uploaded the current prototype version. People who have the prototype PCBs can look here for documentation and to find the bill of materials:
http://code.google.com/p/typhon-reef/
There are 3 ways to have it done:Would anyone be able to help me out with the sketches? I have an arduino uno and the all in one setup for button and LCD display as well as a ds1307 RTC. I am way in over my head with the coding and getting it to not throw error codes when uploading.
Would anyone be able to help me out ....
Welcome back! I have no idea what any of that means lol but @JohnL may be able to help you recover your older usernameIt's been a while, but I'm Spuzzum, the guy who came up with the single button wire setup to free up more LED channels... I couldn't remember my old email, so now I'm just bmichaelb. With that said... I had a working controller, and a working Arduino IDE with all the libraries needed for Typhon. But now, I'm trying to build another, but the library files at Arduino playground are no more. I specifically need EEPROMVar_01.zip. I found an EEPROMVar.h, but I have no idea how to add it to the libraries. Does anybody know where to find the libraries now?
Thanks.
Edit: Never mind... I just needed to copy it to the C:\Arduino directory. Now I just need to figure out why "'PULLDOWN' was not declared in this scope." Never had that issue before.
View attachment 32409039
Edit: Never mind... it seems Nano's and Uno's are different. This sketch is for Uno, and I'm trying with a Nano. If I remove 'PULLDOWN' from the sketch, it works. At least the button portion... it now errors out on others. I think I'll just pick up an Uno and have done with it.
I find a quick conversation with windows copilot can solve just about any programming problem. I ran a 4 channel diy led fixture for the last 2 months off an Arduino Uno. Copilot wrote me the program in about 10 seconds and far more elegantly than what I would have fumbled together.It's been a while, but I'm Spuzzum, the guy who came up with the single button wire setup to free up more LED channels... I couldn't remember my old email, so now I'm just bmichaelb. With that said... I had a working controller, and a working Arduino IDE with all the libraries needed for Typhon. But now, I'm trying to build another, but the library files at Arduino playground are no more. I specifically need EEPROMVar_01.zip. I found an EEPROMVar.h, but I have no idea how to add it to the libraries. Does anybody know where to find the libraries now?
Thanks.
Edit: Never mind... I just needed to copy it to the C:\Arduino directory. Now I just need to figure out why "'PULLDOWN' was not declared in this scope." Never had that issue before.
View attachment 32409039
Edit: Never mind... it seems Nano's and Uno's are different. This sketch is for Uno, and I'm trying with a Nano. If I remove 'PULLDOWN' from the sketch, it works. At least the button portion... it now errors out on others. I think I'll just pick up an Uno and have done with it.
I've never used Copilot, and only heard of it recently, or at least mentioned... I have no idea what it does. - Quick google tells me it's an AI thingamajig.I find a quick conversation with windows copilot can solve just about any programming problem. I ran a 4 channel diy led fixture for the last 2 months off an Arduino Uno. Copilot wrote me the program in about 10 seconds and far more elegantly than what I would have fumbled together.
void readSettings() {
int EEPROM_address = 0;
for (byte i = 0; i < LED_channels; i++) {
EEPROM.get(EEPROM_address, LED[i]);
if (LED[i].versionCheck != 9898) {
// Set default values for the settings and save them to EEPROM
LED[i].versionCheck = 9898;
switch (i) {
case 0:
LED[i].StartMins = 750;
LED[i].PhotoPeriod = 720;
LED[i].Max = 100;
LED[i].FadeDuration = 15;
break;
case 1:
LED[i].StartMins = 720;
LED[i].PhotoPeriod = 720;
LED[i].Max = 100;
LED[i].FadeDuration = 15;
break;
case 2:
LED[i].StartMins = 720;
LED[i].PhotoPeriod = 720;
LED[i].Max = 100;
LED[i].FadeDuration = 15;
break;
case 3:
LED[i].StartMins = 720;
LED[i].PhotoPeriod = 720;
LED[i].Max = 100;
LED[i].FadeDuration = 15;
break;
}
// Variables making use of EEPROM memory:
EEPROMVar<int> oneStartMins = 750; // minute to start this channel.
EEPROMVar<int> onePhotoPeriod = 720; // photoperiod in minutes for this channel.
EEPROMVar<int> oneMax = 100; // max intensity for this channel, as a percentage
EEPROMVar<int> oneFadeDuration = 60; // duration of the fade on and off for sunrise and sunset for
// this channel.
EEPROMVar<int> twoStartMins = 810;
EEPROMVar<int> twoPhotoPeriod = 600;
EEPROMVar<int> twoMax = 100;
EEPROMVar<int> twoFadeDuration = 60;
EEPROMVar<int> threeStartMins = 810;
EEPROMVar<int> threePhotoPeriod = 600;
EEPROMVar<int> threeMax = 100;
EEPROMVar<int> threeFadeDuration = 60;
EEPROMVar<int> fourStartMins = 480;
EEPROMVar<int> fourPhotoPeriod = 510;
EEPROMVar<int> fourMax = 100;
EEPROMVar<int> fourFadeDuration = 60;
// variables to invert the output PWM signal,
// for use with drivers that consider 0 to be "on"
// i.e. buckpucks. If you need to provide an inverted
// signal on any channel, set the appropriate variable to true.
boolean oneInverted = false;
boolean twoInverted = false;
boolean threeInverted = false;
boolean fourInverted = false;
/*
int oneStartMins = 1380; // minute to start this channel.
int onePhotoPeriod = 120; // photoperiod in minutes for this channel.
int oneMax = 100; // max intensity for this channel, as a percentage
int oneFadeDuration = 60; // duration of the fade on and off for sunrise and sunset for
// this channel.
int twoStartMins = 800;
int twoPhotoPeriod = 60;
int twoMax = 100;
int twoFadeDuration = 15;
int threeStartMins = 800;
int threePhotoPeriod = 60;
int threeMax = 100;
int threeFadeDuration = 30;
int fourStartMins = 800;
int fourPhotoPeriod = 120;
int fourMax = 100;
int fourFadeDuration = 60;
*/
// Variables making use of EEPROM memory:
/*
EEPROMVar<int> oneStartMins = 750; // minute to start this channel.
EEPROMVar<int> onePhotoPeriod = 720; // photoperiod in minutes for this channel.
EEPROMVar<int> oneMax = 100; // max intensity for this channel, as a percentage
EEPROMVar<int> oneFadeDuration = 60; // duration of the fade on and off for sunrise and sunset for
// this channel.
EEPROMVar<int> twoStartMins = 810;
EEPROMVar<int> twoPhotoPeriod = 600;
EEPROMVar<int> twoMax = 100;
EEPROMVar<int> twoFadeDuration = 60;
EEPROMVar<int> threeStartMins = 810;
EEPROMVar<int> threePhotoPeriod = 600;
EEPROMVar<int> threeMax = 100;
EEPROMVar<int> threeFadeDuration = 60;
EEPROMVar<int> fourStartMins = 480;
EEPROMVar<int> fourPhotoPeriod = 510;
EEPROMVar<int> fourMax = 100;
EEPROMVar<int> fourFadeDuration = 60;
*/
// variables to invert the output PWM signal,
// for use with drivers that consider 0 to be "on"
// i.e. buckpucks. If you need to provide an inverted
// signal on any channel, set the appropriate variable to true.
boolean oneInverted = false;
boolean twoInverted = false;
boolean threeInverted = false;
boolean fourInverted = false;
int oneStartMins = 1380; // minute to start this channel.
int onePhotoPeriod = 120; // photoperiod in minutes for this channel.
int oneMax = 100; // max intensity for this channel, as a percentage
int oneFadeDuration = 60; // duration of the fade on and off for sunrise and sunset for
// this channel.
int twoStartMins = 800;
int twoPhotoPeriod = 60;
int twoMax = 100;
int twoFadeDuration = 15;
int threeStartMins = 800;
int threePhotoPeriod = 60;
int threeMax = 100;
int threeFadeDuration = 30;
int fourStartMins = 800;
int fourPhotoPeriod = 120;
int fourMax = 100;
int fourFadeDuration = 60;
// create the buttons
Button menu = Button(12,PULLDOWN);
Button select = Button(13,PULLDOWN);
Button plus = Button(14,PULLDOWN);
Button minus = Button(15,PULLDOWN);
// create the buttons
Button menu = Button(12);
Button select = Button(13);
Button plus = Button(14);
Button minus = Button(15);
#include <Arduino.h> //changed from WProgram.h
#include <EEPROM.h>
/*
www.alexanderbrevig.com
AlphaBeta
*/
class EEPROMAddressCounter {
protected:
static int availableAddress;
};
int EEPROMAddressCounter::availableAddress = 0;
template<typename T>
class EEPROMVar :
public EEPROMAddressCounter {
public:
static const byte IS_INITIALIZED = B10101010;
EEPROMVar(T init) {
address = availableAddress;
var = init;
restore();
availableAddress += sizeof(T) + 1; //make room for the is initialized flag
}
operator T () {
return var;
}
EEPROMVar &operator=(T val) {
var = val;
save();
}
void operator++(int) {
var += T(1); //cast for safety
save();
}
void operator--(int) {
var -= T(1); //cast for safety
save();
}
void operator++() {
var += T(1); //cast for safety
save();
}
void operator--() {
var -= T(1); //cast for safety
save();
}
template<typename V>
void operator /= (V divisor) {
var = var / divisor;
save();
}
template<typename V>
void operator *= (V multiplicator) {
var = var * multiplicator;
save();
}
protected:
void save(){
union {
byte raw[ sizeof(T) ];
T data;
} writer;
writer.data = var;
for (byte i=0; i<sizeof(T); i++) {
EEPROM.write(address + 1 + i, writer.raw[i]);
}
}
void restore(){
byte init = EEPROM.read(address);
if (init!=EEPROMVar::IS_INITIALIZED) {
//it was not initialized
EEPROM.write(address,EEPROMVar::IS_INITIALIZED);
union {
byte raw[ sizeof(T) ];
T data;
} writer;
writer.data = var;
for (byte i=0; i<sizeof(T); i++) {
EEPROM.write(address + 1 + i, writer.raw[i]);
}
}
//read from EEPROM
union {
byte raw[ sizeof(T) ];
T data;
} reader;
for (byte i=0; i<sizeof(T); i++) {
reader.raw[i] = EEPROM.read(address + 1 + i);\
}
var = reader.data;
}
T var;
int address;
};
// Current work in progress:
// - store all LED variables in EEPROM so they are not reset by a loss of power