Unknown Command

I am receiving serial data with wireless which originates from

int MyArray1[5] = {1001, 1002, 1003, 1004, 1005};

In my receiving end I used the serial monitor to view what was coming in, and each number was followed by a zero.

if (mySerial.available() > 1) {
    int input = mySerial.parseInt();//
    Serial.println(input);

Does anyone know what the number 1 does, as if I change it to 2, there is no followup zero after the data coming in.

The sketch includes:

#include <SoftwareSerial.h>
SoftwareSerial mySerial(5, 6); // RX, TX

Thanks

Does anyone know what the number 1 does, as if I change it to 2, there is no followup zero after the data coming in.

The available() method returns the number of bytes in the incoming serial data buffer. You are requiring that there be at least two of the 4 that make up each of your values.

By now, you KNOW not to post snippets!

Thanks Paul, does that suggest I should change it to 4. Regards

Have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

...R

Many thanks Robin, very usefull and answers my question.