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

UART #66

Closed
bberrevoets opened this issue Jan 28, 2018 · 1 comment
Closed

UART #66

bberrevoets opened this issue Jan 28, 2018 · 1 comment

Comments

@bberrevoets
Copy link

Can we use the UART Connections on the board from Arduino?
And if the answer is yes, How do i do that?
Because i have a motorboard controller that is communicating over serial, i want that to connect to say UART1 on the board. And i want to create a class to read from the board, so the class must have aacces to the UART, can you give me please an example?

Kind regards
Bert Berrevoets.
opencr

@OpusK
Copy link
Contributor

OpusK commented Jan 29, 2018

Hello, @bberrevoets

First, I apologize for any inconvenience you may have experienced.
We will rearrange the wiki page for the pinmap.

As shown in the illustration above, UART2 and UART4 are used, respectively.
And they are mapped to Serial2 and Serial4, respectively.

So, you can use the Serial2 class to use the UART you asked.

#define SERIAL Serial2

volatile int nCount=0;

void setup() {
  SERIAL.begin(115200);
}

void loop() {
  SERIAL.println("Hello World!!");
  SERIAL.print("nCount : ");
  SERIAL.println(nCount++);
  
  delay(1000);
}

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