solar pump switch
I'm doing a project on solar panel water pump.I need to use C programming to automatically activate the water pump battery from 6pm to 6am for a 4 digit 7-Segment LED.
Here are the codes from my previous project codes for Count Down Timer for AT89C5131 board. So how do I edit from it?
Personally, I'd use some kind of text editor.
See also: Homework policy, How to ask smart questions.
Did you hope for new answers to the same question ?
btw..If you wrote the code in the file you attached, this shouldn't be much different !
> I need to use C programming to automatically activate the water pump battery from 6pm to 6am for a 4 digit 7-Segment LED.
In order to know when 6pm is, you need to know what time it is "now", in order to know when 6pm is actually 6pm.
The MCU you quote doesn't have a real time clock, so does the board you're supplied with have such a clock?
Mind you, the whole "solar" thing is a give-away.
Perhaps all you need to do is put one of these across a couple of I/O pins in order to determine that it is in fact just "dark" outside.
Actually for the original inquiry... I would follow an already suggested route of using a photocell on an analog input. It's smarter than a timer since it can also account for cloud cover, enormous forest fires, volcanic ash, eclipses, massive solar flares and blue moons.