# Sending ASCII with CR without LF

**URL:** <https://forum.arduino.cc/t/sending-ascii-with-cr-without-lf/149402>\
**Category:** Programming\
**Created:** [March 8, 2013, 5:06pm UTC](https://forum.arduino.cc/t/sending-ascii-with-cr-without-lf/149402 "2013-03-08T17:06:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [March 8, 2013, 5:06pm UTC](https://forum.arduino.cc/t/sending-ascii-with-cr-without-lf/149402/1 "2013-03-08T17:06:37Z")

</div>

I am very new to ARDUINO and have only used LabView. I have searches for two days to no avail. I am trying to send a serial command "FECT?" to a hand held LCR. I have found that Serial.println automatically adds a CR and LF. The LF is causing problems.  
I have tried using Serial.print, but cannot figure out how to add the CR.

---

<div class="post-metadata">

**Author:** ![Arrch](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@Arrch](https://forum.arduino.cc/u/Arrch)\
**Post date:** [March 8, 2013, 5:15pm UTC](https://forum.arduino.cc/t/sending-ascii-with-cr-without-lf/149402/2 "2013-03-08T17:15:23Z")

</div>

```cpp
Serial.print('\r');

```

---

<div class="post-metadata">

**Author:** ![krupski](https://avatars.discourse-cdn.com/v4/letter/k/c4cdca/32.png) [@krupski](https://forum.arduino.cc/u/krupski)\
**Post date:** [March 8, 2013, 8:12pm UTC](https://forum.arduino.cc/t/sending-ascii-with-cr-without-lf/149402/3 "2013-03-08T20:12:44Z")

</div>

> David-Keith:  
> I am very new to ARDUINO and have only used LabView. I have searches for two days to no avail. I am trying to send a serial command "FECT?" to a hand held LCR. I have found that Serial.println automatically adds a CR and LF. The LF is causing problems.  
> I have tried using Serial.print, but cannot figure out how to add the CR.

**Arrch** gave you the correct solution. Let me add that you can do it all in one shot. That is, you can use

```arduino
Serial.print("FECT\r");

```

or even better

```arduino
Serial.print(F("FECT\r"));

```

The latter call places the string in PROGMEM rather than SRAM and saves precious memory. Many times, people write code that has a lot of text strings and run out of memory by not using PROGMEM.

For small strings, don't bother, but if you have things like large menus, use PROGMEM.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 5, 2021, 8:06pm UTC](https://forum.arduino.cc/t/sending-ascii-with-cr-without-lf/149402/4 "2021-05-05T20:06:49Z")

</div>


