Skip to main content
added 18 characters in body
Source Link
Juraj
  • 18.3k
  • 4
  • 32
  • 50

You have to connect ground between the modules. Without common ground the logic level of signal can't be measured. While both boards were powered over USB from the same laptop the boards had common ground.

 

read returns -1 if nothing is available so check if some character was received:

void loop() {
  if (Serial1.available()) {
    Keyboard.write(Serial1.read());
  }
}

btw: The MKR can emulate a keyboard too with the KwyboardKeyboard library.

You have to connect ground between the modules. Without common ground the logic level of signal can't be measured. While both boards were powered over USB from the same laptop the boards had common ground.

read returns -1 if nothing is available so check if some character was received:

void loop() {
  if (Serial1.available()) {
    Keyboard.write(Serial1.read());
  }
}

btw: The MKR can emulate a keyboard too with the Kwyboard library.

You have to connect ground between the modules. Without common ground the logic level of signal can't be measured. While both boards were powered over USB from the same laptop the boards had common ground.

 

read returns -1 if nothing is available so check if some character was received:

void loop() {
  if (Serial1.available()) {
    Keyboard.write(Serial1.read());
  }
}

btw: The MKR can emulate a keyboard too with the Keyboard library.

Source Link
Juraj
  • 18.3k
  • 4
  • 32
  • 50

You have to connect ground between the modules. Without common ground the logic level of signal can't be measured. While both boards were powered over USB from the same laptop the boards had common ground.

read returns -1 if nothing is available so check if some character was received:

void loop() {
  if (Serial1.available()) {
    Keyboard.write(Serial1.read());
  }
}

btw: The MKR can emulate a keyboard too with the Kwyboard library.