0

I would like to use the Teency 3.2 as a mouse and also use serial communication. I have to use the usb native port on the due to emulate the mouse. Is it possible to use serial communication on the native port?

I would be very thankful if somebody could explain (in simple language) how to set up serial communication via the native usb port (what bps rate should I use?).

zisosak
  • 53
  • 6

2 Answers2

0

"Is it possible to use serial communication on the native port?"...

Yes,

To use serial, make sure the Tools > USB Type menu is set to "Serial", and understand Teensy only becomes a serial device when it runs your program built with this setting.

Quoted from here.
(Important that you read through this link, as there are other considerations that are important to note in order to use the serial port/ USB for what you are intending.)

"what bps rate should I use?"

A suggested baud rate for USB connections is 57600, however it may be useful to go beyond this.

Possible rates include: 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, or 115200. All of these are given in bits per second.

To open a Serial connection, the function Serial.begin(57600); is required in the setup function. Serial.print(), Serial.println() and Serial.write() can all be used to send data from the Teensy to the computer.

Quoted from here

ryyker
  • 22,849
  • 3
  • 43
  • 87
0

If you set the USB-Mode to one of the HID modes (e.g. Keyboard+Mouse+Touch) the Teensy doesn't work as Serial over USB. However, all HID modes implement an additional SerEmu interface. From the Teensy side you can use it in the same way as you would use the normal USB Serial. E.g. just do Serial.print... The Arduino Serialmonitor and TyTools handle this out of the box, nothing to set or change.

If you need to communicate over SerEmu with your own PC app you need to know that SerEmu implements a simple RawHID interface to exchange data. Here a link showing how to implement this with c#/Win10. https://github.com/TeensyUser/doc/wiki/Raw-HID

luni64
  • 321
  • 2
  • 8