In this case, once I realized that two independent BWD's would do the job I took the BWD example and did a bit of copy & paste - you can see the evidence in some of the variable names I lazily left unchanged.
At that point, the LED code was complete. From there it was just top down design & functional decomposition to complete the management of the pump i.e. I tweaked the ManagePump function and when I came to a bit I didn't immediately want to do, I assumed a function that would do what I needed so I could complete the one I was working on.
That assumed function turned out to be GetPumpInterval. It in turn assumed that there would one day be a function that knows whether it is daylight or not. The Daylight function turned out to need no more support functions so that was that.
So, the LDR came last because I didn't need it until I wrote the Daylight function. It was obvious of course that it would have to be read at some point, but initially, I didn't know when that point would be.
With this approach, assuming a function you need and filling it in later, it sometimes feels that the program is almost writing itself. In a more complex piece of software, you will likely need much more design up front, but even then, you can use this technique when you get into the details - it lets you focus on a little bit of code at a time rather than worrying about the big picture.
Of course, it's not infallible - sometimes you'll find that some idiot (yourself) has painted themselves into a corner and you'll need to backtrack until you untangle the mess you've made