Connecting third usb slave device to particle photon

photon has only 2 usb ports
suppose both ports get occupied
then how do we connect third usb device to it?

we have only Serial.write() and Serial1.write()
how do we connect a third usb device and send commands to it?

thanks,
Nitin

Since when has the Photon two USB ports?

Serial is (the only) one virtual serial port via USB.
Serial1 is a UART port which has nothing to do with USB.
Serial2 is the secondary UART and is documented what you need to consider in order to use it.

And finally for the Gen2 devices there is a ParticleSoftSerial library that allows to use two selectable pins to simulate a UART.

3 Likes

@nitinjs123, besides what @ScruffR pointed out, you can also use an external I2C-to-UART bridge with the library supplied by @rickkas7:

Thats great library

I wonder which photon pins I can use with this library?

thanks

The library states

*  Soft RX pin needs to be interrupt enabled, so on Photon D0 & A5
*    won't work as RX

So on a Photon you can use any GPIO pin for TX and any but D0 & A5 as RX.

Also be aware that faster baudrates (>28800) can introduce timing related artefacts on longis RX packets.
Beyond 28800 you should perform some tests by sending Serial1 messages of representative length to the SoftSerial RX pin to check reliability.