BillyNoMates
Newly Enlightened
This is an interesting thread. I used a PIC 16F506 in the bike light / headtorches I've been building. These little beasts are a great way of customisng the operation of any home brew light.
I wrote the program in assembler and here is a list of the functionality I included in my first application:
Four brightness settings (spaced apart by a factor of x3 in power) and two strobe settings (for urban riding).
Single button operation; long press to wake-up / sleep, double click to increase brightness, single click to decrease brightness (Note this control drives enable pins on the driver ICs rather than PWM).
Battery voltage monitor used to drive tri-colour LED and force minimum brightness mode when battery reaches 80% depleted.
Memory function that remembers the last brightness setting used when powered down. This resets to the initial state if the battery is disconnected.
Here's a pic of the PIC on my custom driver board (5x rebel headtorch / bike tail light design).
I wrote the program in assembler and here is a list of the functionality I included in my first application:
Four brightness settings (spaced apart by a factor of x3 in power) and two strobe settings (for urban riding).
Single button operation; long press to wake-up / sleep, double click to increase brightness, single click to decrease brightness (Note this control drives enable pins on the driver ICs rather than PWM).
Battery voltage monitor used to drive tri-colour LED and force minimum brightness mode when battery reaches 80% depleted.
Memory function that remembers the last brightness setting used when powered down. This resets to the initial state if the battery is disconnected.
Here's a pic of the PIC on my custom driver board (5x rebel headtorch / bike tail light design).