Skip to content

Adding Pinoccio Scout to Boards.h #220

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

Merged
merged 5 commits into from
Oct 18, 2015
Merged

Conversation

makenai
Copy link
Contributor

@makenai makenai commented Oct 5, 2015

This adds a definition to Boards.h for the Pinoccio Scout, an Arduino compatible device similar to the Mega, as seen here: https://pinocc.io/

@soundanalogous
Copy link
Member

Please also add the UART pins. See how I've done this for Mega. It should be similar for Pinoccio.

Also add the IS_PIN_SERIAL macro. Looks like this for Mega: https://github.com/firmata/arduino/blob/master/Boards.h#L215.

@makenai
Copy link
Contributor Author

makenai commented Oct 17, 2015

@soundanalogous Thanks - I've rebased and added the UART pins and macro per your recommendation

#define PIN_SERIAL1_TX 1
#define PIN_SERIAL2_RX 13
#define PIN_SERIAL2_TX 14
#define IS_PIN_DIGITAL(p) (((p) >= 2) && ((p) <= 8)) || (((p) >= 24) && ((p) <= 31))
Copy link
Member

Choose a reason for hiding this comment

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

Do pins 0 and 1 map to Serial or Serial1? If they map to Serial1, the you should be able to use pins 0 and 1 as digital inputs unless those pins don't have digital I/O for some other reason.

Copy link
Member

Choose a reason for hiding this comment

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

Okay I found the pinout for the Pinoccio. They did tie the usb serial to digital pins 0 and 1. The number at the end of PIN_SERIAL aligns with the Serial object, so PIN_SERIAL1 is for Serial1, PIN_SERIAL2 is for Serial2. You should remove lines 568 and 569 and change the following 2 lines to PIN_SERIAL1 (so you'll only map to pins 13 and 14 for now since the default Serial object is reserved for Firmata communication). At some point I'll open it up when using Firmata via a non-serial channel such as Ethernet or WiFi.

@makenai
Copy link
Contributor Author

makenai commented Oct 17, 2015

Thanks for looking that up for me and for your patience in explaining it. I was wondering why the numbering started at 1 and not 0, so that makes perfect sense.

Per your earlier comment, I've also extended the range of digital pins to include 9-16 which are mapped this way:

#define SS              9
#define MOSI            10
#define MISO            11
#define SCK             12
#define RX1             13
#define TX1             14
#define SCL             15
#define SDA             16

Does that look correct?

@soundanalogous
Copy link
Member

If those pins can be used as digital I/O pins then they should be included in the range of digital pins. You should test it against StandardFirmata if you have not already. Users may not know which digital pin numbers to specify for those pins since they fall out of order as they are arranged on the board. It would be helpful to document this somewhere. Add a comment to the code here. It may end up being a bit of a hidden feature.

@makenai
Copy link
Contributor Author

makenai commented Oct 18, 2015

Roger that. I've verified all the digital pins work to blink an LED and added a comment to explain the numbering.

@soundanalogous
Copy link
Member

Cool I think we're good here. Merging...
Thanks!

soundanalogous added a commit that referenced this pull request Oct 18, 2015
Adding Pinoccio Scout to Boards.h
@soundanalogous soundanalogous merged commit 8db68d0 into firmata:master Oct 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants