Skip to content

Add definitions of Serial1x#34

Closed
matsujirushi wants to merge 1 commit into
Seeed-Studio:masterfrom
matsujirushi:dev-matsujirushi
Closed

Add definitions of Serial1x#34
matsujirushi wants to merge 1 commit into
Seeed-Studio:masterfrom
matsujirushi:dev-matsujirushi

Conversation

@matsujirushi
Copy link
Copy Markdown

Serial1x can communicate Raspberry Pi UART.

Uart Serial1x(&SERCOM_SERIAL1X, PIN_SERIAL1X_RX, PIN_SERIAL1X_TX, PAD_SERIAL1X_RX, PAD_SERIAL1X_TX);
INTERRUPT_HANDLER_IMPLEMENT_SERIAL1X(Serial1x)

void setup() {
  SerialUSB.begin(115200);
  Serial1x.begin(9600);
}

void loop() {
  while (Serial1x.available() >= 1)
  {
    SerialUSB.write(Serial1x.read());
  }
  while (SerialUSB.available() >= 1)
  {
    Serial1x.write(SerialUSB.read());
  }
}

@matsujirushi
Copy link
Copy Markdown
Author

Review comment:

You replaced Serial1 with sercom4, but sercom4 was previously occupied by i2c1, which can cause other problems.

@LynnL4
Copy link
Copy Markdown
Member

LynnL4 commented Nov 6, 2020

Thanks!

@LynnL4 LynnL4 closed this Nov 6, 2020
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