LED moonlights that dim to the 29.5 day lunar cycle

You can work out the math to do all of this, or add an RTC to send an interupt once every 12 hours or 1 hour or whatever.

Bean
 
<a href=showthread.php?s=&postid=6541834#post6541834 target=_blank>Originally posted</a> by jent46bow

If anyone wants to see my very VERY ruff code here it is:
http://pastebin.com/514051

this post is more of a documentation of how it all ended, than looking for help.

I tried to find your code but when I used your link there was nothing there. I could check out other posts.
 
The PIC would definately work for you as an LED dimmer. Your best bet would be to use the programmable PWM output into a driver circuit to control the duty cycle and thus the intensity. You can have a 32.768kHz clock to generate an interrupt every second to increment the system time. By storing the pre-calculated sin fucntion in an array you can lookup the intensity by what day you are at in the cycle. Your biggest challenge with a PIC would probably be getting a programmer if you do not already have one. I would recommend the ICD2 (in circuit debugger/programmer). It may be cost prohibitive for a simple LED timer circuit, but at least you will have it for future projects. Also look into the trial version of the C18 compiler if you want to avoid assembly like I do.

This DIY controller will probably cost more and be a bigger headache than one bought off of the shelf, but what is the fun of that.

Good Luck
Mike
 
Back
Top