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

Change the Serial pins #4

Open
fqantonio opened this issue Jun 27, 2019 · 6 comments
Open

Change the Serial pins #4

fqantonio opened this issue Jun 27, 2019 · 6 comments

Comments

@fqantonio
Copy link

I'm using ATMEGA328p with RN4871 BLE. The serial pins I'm using are the arduino 0,1 ( RX, TX) and not the 25 and 26 of your fubarino. How can I change that? Thank for your work. Best

@JacobChrist
Copy link
Member

JacobChrist commented Jun 27, 2019 via email

@EmbeddedMan
Copy link

I think that you can just use the normal Arduino serial object in this line
#define bleSerial Serial1 // Serial1 is UART2 on pins 26 (TX) and 25 (RX) to BLE module
In other words, we don't actually set those pins in the library anywhere. You pass into the library a serial object of a certain name (for Fubarino, that's "Serial1"), and that serial object has certain TX and RX pins associated with it (which are not changeable). For every board type these may come out on different pins.
Is the normal serial port (pins 0 and 1) on an Arduino just "Serial"? If so, then you can just use "Serial" in place of "Serial1" in the examples. That will mean, however, that you will need to disable all of the norma PC-serial stuff, since that's currently using the "Serial" object.

@EmbeddedMan
Copy link

fquantinio is not using a Fubarino, but rather a normal Arduino. The library should not need any modifications other than just passing in the proper serial object.

@fqantonio
Copy link
Author

I think that you can just use the normal Arduino serial object in this line
#define bleSerial Serial1 // Serial1 is UART2 on pins 26 (TX) and 25 (RX) to BLE module
In other words, we don't actually set those pins in the library anywhere. You pass into the library a serial object of a certain name (for Fubarino, that's "Serial1"), and that serial object has certain TX and RX pins associated with it (which are not changeable). For every board type these may come out on different pins.
Is the normal serial port (pins 0 and 1) on an Arduino just "Serial"? If so, then you can just use "Serial" in place of "Serial1" in the examples. That will mean, however, that you will need to disable all of the norma PC-serial stuff, since that's currently using the "Serial" object.

Yes, that's the problem. To program the ATMEGA328p I use the FTDI (RX TX pins 0,1). But I also use them, when I don't have the FTDI pluged on to the board, for the BLE RN4871. You say if I use only Serial I will use the common pins 0 and 1?

@fqantonio
Copy link
Author

fquantinio is not using a Fubarino, but rather a normal Arduino. The library should not need any modifications other than just passing in the proper serial object.

That's true! But if I also use the same serial to the FTDI (even if it is not pluged into the Board when I'm using the BLE). Use the same serial? FTDI and BLE are exclusives, I use one or the other, not both.

@EmbeddedMan
Copy link

EmbeddedMan commented Jun 27, 2019 via email

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

3 participants