Am I thinking correct with the steps I need for my lighting object?
lockadoc
Posts: 115
I would like to know if my object logic is correct for what my goal is? Am I breaking it down enough for my goal or am I forgetting some detail that will drive me nuts.
The goal I'm going for in this object is an Eight channel light timer for some party lights.I have a four hundred foot long chain of 120 volt lights. the controller will be in the middle with four channels to the left and four to the right using 8)25amp solid state relays.
All the lights will come on at dusk ,than At 11:00pm 2 channels will go off, At 12:00am 2 more channels will go off,At 1:00am 2 more channel will go off, Leaving the two remaining channels on until dawn.
Added features:
1- Have some preprogrammed light displays that run for a few minutes than return to the default light timing control
2- A TV remote control to run the various light displays along with a maintenance display for checking that different color bulbs are working and on the correct channel
3- With the push of a button (one on the controller box with an other on the TV remote control) all lights will go back on for one hour then return to the default timing control .
I think it will take three clogs with two objects, with the first object doing input readings and the second one controlling the outputs to prevent pin interaction with the different methods outputs
Top object will start the timer and an IR receiver in other clogs,than will scan inputs( button,IR receiver and photo-resistor (for dusk and dawn))
When input is detected it will pass control to the light controller object or when timer is at programed times it will change light outputs to deativate pins when timer is equal to 11:00pm – 11:59pm two channels will go off,when timer is equal to 12:00am – 12:59 am four channels will be off,when timer is greater than 1:00am only two channels will be on.
The second object will be the light controller,when Photo-resister detects dusk it turn on all lights when button input if sensed ( it will override timers setting) it will cycle the different light displays for three minutes, but run maintenance displays until next button input.When dawn is sensed all lights will be off .
BillyS
The goal I'm going for in this object is an Eight channel light timer for some party lights.I have a four hundred foot long chain of 120 volt lights. the controller will be in the middle with four channels to the left and four to the right using 8)25amp solid state relays.
All the lights will come on at dusk ,than At 11:00pm 2 channels will go off, At 12:00am 2 more channels will go off,At 1:00am 2 more channel will go off, Leaving the two remaining channels on until dawn.
Added features:
1- Have some preprogrammed light displays that run for a few minutes than return to the default light timing control
2- A TV remote control to run the various light displays along with a maintenance display for checking that different color bulbs are working and on the correct channel
3- With the push of a button (one on the controller box with an other on the TV remote control) all lights will go back on for one hour then return to the default timing control .
I think it will take three clogs with two objects, with the first object doing input readings and the second one controlling the outputs to prevent pin interaction with the different methods outputs
Top object will start the timer and an IR receiver in other clogs,than will scan inputs( button,IR receiver and photo-resistor (for dusk and dawn))
When input is detected it will pass control to the light controller object or when timer is at programed times it will change light outputs to deativate pins when timer is equal to 11:00pm – 11:59pm two channels will go off,when timer is equal to 12:00am – 12:59 am four channels will be off,when timer is greater than 1:00am only two channels will be on.
The second object will be the light controller,when Photo-resister detects dusk it turn on all lights when button input if sensed ( it will override timers setting) it will cycle the different light displays for three minutes, but run maintenance displays until next button input.When dawn is sensed all lights will be off .
BillyS
Comments
one for receiving the IR-remote-control-signals
one for the timer
one for all the rest.
this COG will run a program with a big repeat-loop that is checking
1) the photoresistor
2) the button
3) any kind of timing (all lights flipping around on/off for three minutes turn on again for an hour turn off some lights after 2 hours or what amount of time you ever like
You can divide all this to different COGs, but that's not nescessary.
Just start programming. There's nothing easier to modify than a program. Start the editor cut and past parts of code to whereever you like to modify it.
best regards
Stefan
Post Edited (StefanL38) : 10/15/2009 5:34:05 PM GMT
this is what I've gotten so far ,Right now I'm trying just making two parts· work for now.But I must have my indentation wrong on the lighting part. the heartbeat works when I run it without trying it in a new cog (guess I don't know how to make it start)·I've spent·a bunch of hours·on it and still don't have it running.COULD someone give me a few hints on these two items.
Thanks BillyS
······ PS
············ On the good side I have all the hardware up and running using the prop····
············ proto board with Eight 25 amp solid state relays mounted in a weather tight box
············ I'll upload a pic in a few days.
·······
two things:
1) the second, third etc. if-conditions are indended to deep they belong to the first if condition
the "i" of ALL if-conditions have to be in the same columm
2) you have to set the output-pins
you need to add
inside of your repeat-loop
best regards
Stefan
Post Edited (StefanL38) : 10/16/2009 9:42:39 AM GMT