dhiltonp/hexbright

Suggestion: Two programs at once

peterlewis opened this issue · 3 comments

Just a suggestion, it would be great if there was a way to load two programs at once, for instance having the Tactical program for day-to-day use and when cycling be able to switch over to the BikeLight program.

Such a change could possibly be done through double-tapping the button when the light is off or holding the button for five seconds?

How feasible is such an idea?

It is feasible, yes.

There is the trouble of finding a control scheme that wouldn't interfere with any existing controls. The 5 second hold while off to switch is a pretty good suggestion, but that would mean that whatever programs it is selecting between shouldn't activate until after the button is released.

I've thought a fair amount about schemes for switching programs, but it is a difficult problem. Whatever scheme is selected, it will have to take precedence over some input combination that may be in use by existing programs.

I have thought about this too, and I think if I can devise a way to encode everything I want to do in a program I could store it. The main program would then read in the encoding for each setup and then act on the clicks based on the currently selected encoding. Each encoding could be stored in PROGMEM and then the currently selected encoding stored in EEPROM. When the program starts, it reads which encoding to load, then loads it up and then starts reacting to button presses based on that.

I guess I will start working on it. :-)

Closing this issue as it is ancient! :)