Being new to PICs (and now this excellent forum) but an old hand at electronics I want to replace my curtains / lights controller comprising of 8 i/c's and a bucketful of components and relays with a PIC and some software....so far so good.
I need a program to read the light level from an LDR (I should be able to manage that), if below a certain value wait for a few minutes to prevent operation by clouds etc., then if still low activate an output for about 2 seconds to operate the switch of a commercial RF remote controlled lights system, then after a further few minutes delay activate another output for a few seconds to close my motorised curtains.
The curtains remain closed until it is daylight again and a separate stand alone timer currently turns the lights off at a set time, I would prefer to keep this for simplicity rather than incorporate a real time clock module.
Like I said I am completely new to programming and I can't see how to make the main program run repeatedly (checking light level) and then also driving a relay or similar output.
Any guidance appreciated and I hereby promise to publish the completed circuit whan I have done it....and I WILL do it !
Thanks in anticipation
I need a program to read the light level from an LDR (I should be able to manage that), if below a certain value wait for a few minutes to prevent operation by clouds etc., then if still low activate an output for about 2 seconds to operate the switch of a commercial RF remote controlled lights system, then after a further few minutes delay activate another output for a few seconds to close my motorised curtains.
The curtains remain closed until it is daylight again and a separate stand alone timer currently turns the lights off at a set time, I would prefer to keep this for simplicity rather than incorporate a real time clock module.
Like I said I am completely new to programming and I can't see how to make the main program run repeatedly (checking light level) and then also driving a relay or similar output.
Any guidance appreciated and I hereby promise to publish the completed circuit whan I have done it....and I WILL do it !
Thanks in anticipation