Terrapin-Rocket-Team / Multi-Mission-Flight-Software

An arudino library used by the Terrapin Rocket Team as the foundation of the team's flight software.
5 stars 0 forks source link

Implement BlinkBuzz Improvements #49

Closed DrewBrandt closed 1 month ago

DrewBrandt commented 3 months ago

IDK if anyone else wants to take a stab at this, the files are a bit complicated. I probably won't for at least a few weeks, probably longer as I don't currently have a use-case.

Some improvements:

The idea for the last one is that you might have one long blink followed by three short blinks, or maybe Morse code or something. Currently, doing this pattern once is feasible, just call aonoff twice with the two different durations and they will be queued one after the other. The problem is if you want to indefinitely repeat a non-uniform blink pattern. The internal queuing system currently only supports a single pattern indefinitely.

What would a call to this method look like?

Maybe

bb.aonoff(PIN#, ON_time1, OFF_time1, ON_time2, OFF_time2, ON_time3 OFF_time3, ... );

? Seems clunky but I don't currently have a better idea. Maybe you could do something like

bb.startIndefiniteQueue(PIN#);
bb.aonoff(PIN#, DURATION1, NUM_TIMES1, PAUSE1);
bb.aonoff(PIN#, DURATION2, NUM_TIMES2, PAUSE2);
bb.endIndefiniteQueue(PIN#);

Where you could queue up indefinite patterns between those two guards.

Any suggestions?