Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add blink-pattern functionality to Atm_led #40

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dsjstc
Copy link

@dsjstc dsjstc commented Apr 6, 2017

Allows an LED object to blink in a pattern specified in a byte array. Each element in the array is a multiplier for the on time. I wanted this so I can chain up blinked error codes.

Also, resetting the counter when state() == OFF seems useful for any kind of repeat, not just patterns.

@jbarchuk
Copy link

Bump. I like this.

@00benallen
Copy link

@tinkerspy bump

@@ -1,6 +1,6 @@
#include "Atm_led.hpp"

Atm_led& Atm_led::begin( int attached_pin, bool activeLow ) {
Atm_led& Atm_led::begin( int attached_pin, bool activeLow, byte* blinkPattern, int blinkPatternSize ) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this require that one supply the third and fourth argument? What about adding another method with this, so people who don't want to use the blink pattern can do so like before?

@tinkerspy
Copy link
Owner

I would prefer this functionality to be in a separate library and not in the standard Atm_led machine perhaps under the name Atm_led_pattern. We could put it under contributed in the Wiki.

https://github.com/tinkerspy/Automaton/wiki/Contributed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants