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

Uses old version of Firmata #7

Open
soundanalogous opened this issue Jan 9, 2016 · 2 comments
Open

Uses old version of Firmata #7

soundanalogous opened this issue Jan 9, 2016 · 2 comments

Comments

@soundanalogous
Copy link

This is based on an old version of Firmata and thus inherits various bugs that have been subsequently fixed over the years. I maintain the Firmata library here: https://github.com/firmata/arduino. I'm happy to collaborate if you want to make your version better. I also have a version of StandardFirmataBLE in the works (currently targeting Arduino 101) that I may be able to add a config file to support other chipsets as well.

@ladyada
Copy link
Member

ladyada commented Jan 9, 2016

i doooo! but... i had to get rid of boards.h because i need to be able to 'reserve' pins for the bluefruit interface and those pins are variable, which is why i refactored to let this verison use arrays defined in the example sketch....
so....thoughts?

@soundanalogous
Copy link
Author

There are a few improvements in later versions of Firmata that have made this type of integration easier. To highlight a few:

There is an pin mode PIN_MODE_IGNORE that can be used to ignore pins that are used by shields or other peripherals. Here's an example from the newly added WiFi version of StandardFirmata. And the macros for individual shields. It prevents Firmata from messing with these pins and blocks users from accessing them via setPinMode, etc. Using this method, it should also be possible to enable users to ignore additional pins by adding conditions to these types of macros.

Since Firmata v2.3.6 you can pass in a Stream reference to Firmata.begin. This way as long as a transport extends Stream or can otherwise be wrapped by a Stream implementation, it can be passed to Firmata and Firmata will call it's read, write and available methods. Here's an example wrapper from the BLE support that is in progress for the Arduino 101 (also note that in this particular example, the buffering that is happening with the writes is extremely helpful for BLE. I have successfully tested analog reads at a BLE connection interval of 30ms).

As of Firmata v2.5.1 specifying VERSION_BLINK_PIN is optional. However for ATmega32u4-based boards or ATmega328p boards this would still be an issue unless there was another define to uniquely identify the board so that VERSION_BLINK_PIN can be undef'd in the context of Boards.h.

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

No branches or pull requests

2 participants