Show Posts
Pages: [1]
1  Using Arduino / Interfacing w/ Software on the Computer / Re: Serial relay on: February 12, 2011, 06:38:40 pm
Thanks to those that have replied. I have a Windows program that I wrote using AutoIt that outputs the serial stream at 19200 directly to the Arduinos serial port through the USB connection. I then use Hyperterminal to read the output from the Arduino using my laptops serial port. All communications are at 19200 because I am using software to simulate the output of a custom board that uses a propellar chip.

Jason
2  Using Arduino / Interfacing w/ Software on the Computer / Serial relay on: February 12, 2011, 10:59:54 am
Hello, I am trying to get my Arduino to relay the serial data it receives. Here is the sketch that I have:

#include <NewSoftSerial.h>
#define rxPin 2
#define txPin 3

byte incomingByte = 0;

NewSoftSerial nss(rxPin, txPin);

void setup()                    // run once, when the sketch starts
{
  Serial.begin(19200);
  nss.begin(19200);
}

void loop()                     // run over and over again
{

// Read from the hardware UART.
// If any data is available, write it out through the software serial

  if (Serial.available() > 0) {
    incomingByte = Serial.read();
    nss.print(incomingByte);
  }               
}

I have a simple windows app that is sending the following text strings repeatedly with a carriage return after each string.
1I5ED
2I5ED
3I5ED
4I5ED
5I5ED
6I5ED

Monitoring what the Arduino is sending out, the first 340 times it's fine then it starts to miss characters. See below.
1I5ED
2I5ED
3I5ED
I5ED
5I5ED
6I5E
1I5ED
2I5ED
3IED
4I5ED
5I5ED
I5ED

Is it a buffer problem? Does anyone have any ideas on how best I should do this?
Pages: [1]