I have been working for a while on a intelligent lighting controller. Finally there are some variables which may have to change individually and I was thinking of adding a LCD display which is not a big problem even I have to go for an option adding another shift register since I have only four digital pins left.
Now the big question:
To show what I mean, I through in a part of my variable declarations:
unsigned int sensitivity = 500; //should be between 200 and 1000 as
//lower the number as more responsive
//the system will be
unsigned int photoCellCutOn = 320; //var holding the switching limit for the photocell
unsigned int photoCellCutOff = 280; //var holding the value where the photocell cuts off
unsigned int photoOutsideOn = 220; //var holding the value which the photocell reading
unsigned int photoOutsideOff = 260;
long int dBed1 = 60000; //delay time in milliseconds for bedroom 1
long int dBed2 = 60000; //delay time in milliseconds for bedroom 2
long int dBed3 = 60000; //delay time in milliseconds for bedroom 3
long int dLiving = 300000; //delay time in milliseconds for living area
long int dBath1 = 180000; //delay time in milliseconds for bathroom 1
long int dBath2 = 180000; //delay time in milliseconds for bathroom 2
long int dBath3 = 180000; //delay time in milliseconds for bathroom 3
long int dBath4 = 180000; //delay time in milliseconds for bathroom 4
long int dKitchen = 120000; //delay time in milliseconds for kitchen
long int dCorridor = 60000; //delay time in milliseconds for corridor
long int dAC1 = 120000; //delay time in milliseconds for AC 1 (bed1)
long int dAC2 = 120000; //delay time in milliseconds for AC 2 (bed2)
long int dAC3 = 120000; //delay time in milliseconds for AC 3 (bed3)
long int dAC4 = 120000; //delay time in milliseconds for AC 4 (living)
long int dMaster = 240000; //delay time in milliseconds for Master Off
////////////Room 1 (Bed 1) ///////////
byte room1MActive = 1; //Set to 1 if you want to process
//Timer will be ignored when set to 0
unsigned int room1OnM[2] = {5, 35}; //Time to switch on the lights 5
unsigned int room1OffM[2] = {6, 5}; //Time to switch off the lights 6
byte room1O1Active = 1; //Set to 1 if you want to process
//Timer will be ignored when set to 0
unsigned int room1On1[2] = {19, 35}; //Time to switch on the lights
unsigned int room1Off1[2] = {20, 15}; //Time to switch off the lights
byte room102Active = 1; //Set to 1 if you want to process
//Timer will be ignored when set to 0
unsigned int room1On2[2] = {21, 5}; //Time to switch on the ;ights
unsigned int room1Off2[2] = {21, 15}; //Time to switch off the lights
////////////Room 2 (Bed 2) ///////////
byte room2MActive = 1; //Set to 1 if you want to process
//Timer will be ignored when set to 0
unsigned int room2OnM[2] = {6, 30}; //Time to switch on the lights
unsigned int room2OffM[2] = {6, 50}; //Time to switch off the lights
byte room201Active = 1; //Set to 1 if you want to process
//Timer will be ignored when set to 0
unsigned int room2On1[2] = {19, 30}; //Time to switch on the lights
unsigned int room2Off1[2] = {20, 10}; //Time to switch off the lights
As you can see, I am working with cut off points for lights depending on photocell readings which may have to be changed depending where the photocell is finally installed. The same thing goes for the timers in the last part of the shown declarations.
Unfortunately at this point I am currently a little lost and I am not sure if it's possible anyway....
- Is there a way of implementing a simple menu to change this variables?
Since I have been reading through libraries and form posts for a couple of days, I found only libraries which are quite memory consuming. Since the main program is already quite big the menu has to be simple and small (main problem). - Is there a way that the Atmega 328 can write to itself to change this variables kind of permanent so not everything is lost during a power cut or do I have to look at working with a external memory chip or a SD-card holding this variables?
Thanks for having a look at and your suggestions.