简体   繁体   中英

Serial Communication over Desktop to Arduino

I have a USB 2 Serial adapter and the device is working fine. I see the device perfectly configured in my System.

I have connected the TX0 pin of Arduino to DB 2 pin (read pin) of the adapter. Below is my Arduino code:

int i = 0;
void setup()
{
  Serial.begin(9600);
}

void loop()
{
  for(i=0;i<6;i++)
  {
  Serial.write('H');
  delay(100);
  }
}

But when I try to read thru terminal software of data received at my COM port I see some junk character incoming. I am pretty sure that I am using same baud rate / flow setting both side. Why am I facing this issue - do I need to connect any other pins also as I just need to receive data at system side?

您应该将接地引脚与接地引脚连接

Arduino Communicate with Ur computer using pins 0 and 1( Tx0 and Rx0) you shouldn't be connected to the Tx0 pin to another serial device because arduino use it to communicate with computer. if you are using Uno. Check for Software Serial. and two grounds should be connected.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM