Skip to content

Conversation

@cmaglie
Copy link

@cmaglie cmaglie commented Dec 8, 2015

This may be useful for boards without a built-in led or if you simply want to disable this feature.

Also removed a redundant pinMode (the pin is already set as output inside strobeBlinkPin).

@soundanalogous
Copy link
Member

I'd rather have blinkVersion() do nothing in this case to avoid the calls to delay. Add the compiler conditional inside blinkVersion() instead so it essentially does nothing if the LED pin is not specified. This should be safe since strobeBlinkPin() is private and is only called by blinkVersion().

@soundanalogous
Copy link
Member

@cmaglie I've made an alternative version that avoids the delays in blinkVersion. However I'm not sure how the feature can be disabled as you requested, other than the user modifying Boards.h to undefine VERSION_BLINK_PIN for a particular board. Let me know if you have any ideas. I tried adding the following here

#if defined(VERSION_BLINK_PIN) && !defined(FIRMATA_SKIP_BLINK_VERSION)

and then defining FIRMATA_SKIP_BLINK_VERSION in a sketch before including Firmata.h but that doesn't work. I assume Firmata.h is compiled before any defines above it in a sketch are evaluated by the preprocessor. Perhaps there is something simple I am overlooking.

@cmaglie cmaglie deleted the optional-led-builtin branch April 18, 2016 16:20
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.

2 participants