Serial Communication Syntax

Hi, Hopefully someone can help me.

I am using an Arduino Mega to interface with a device which requires several parameters set up over serial for correct operation. The documentation for the device specifies that the serial string sent to it should be in the format


with ‘s’ being the parameter i am trying to set up, being a value between 0 and 1 to four decimal places, and denoting a carriage return.

I would have thought that the below would work.


However the device seems to just ignor this command.

I know the serial comms are working as they should as I am able to communicate with it successfully to change other parameters - The problem appears to be just when sending numeric values.

Can anybody see what I am doing wrong, or any suggestions for different methods would be appreciated.

Thanks in advance

I believe that Serial.println terminates with both a CR and an LF. I’m not sure whether they mean CR by or LF.

Try the following:




to find out which works.

Hi Majenko,

Thank you for your quick reply.

Unfortunately both of those have the same result as println - the device just seems to ignor it =(

Do you have a link to the documentation of the device?

the device just seems to ignor it

Then maybe it's time for you to tell us what this mysterious device is, and how you KNOW it is ignoring the data.

And post all your code. What baud rate? Do you do Serial.begin()? Is it wired up correctly?