Go Down

Topic: Leonardo won't initiate serial communication (Read 17496 times) previous topic - next topic

tonyar

I realise this is an old thread, but I'm just commenting to thank V4Friend for the hint about DTR.

I have an Arachnid Tsunami (Leonardo based device) and I wrote an extensive vb.net program to control it.

I did all my initial testing on an Arduino Nano and everything worked fine.

As soon as I switched to the Tsunami (Leonardo), I was unable to receive data from the serial port (sending seemed to be ok).

This is my vb.net serial initialisation code which seems to work fine now.

Code: [Select]

                SerialPort1.PortName = comPORT
                SerialPort1.BaudRate = 115200
                SerialPort1.DataBits = 8
                SerialPort1.DtrEnable = 1     ' enable DTR *****
                SerialPort1.Parity = Parity.None
                SerialPort1.StopBits = StopBits.One
                SerialPort1.Handshake = Handshake.None
                SerialPort1.Encoding = System.Text.Encoding.Default
                SerialPort1.ReadTimeout = 10000


Also, in the Arduino I added this:

Code: [Select]

  Serial.begin(115200);
  while (!Serial)
  {}




Go Up