Parsing/Deciphering strings with a single Token for LCD Position.

Hi all, I'm fairly new to the programming scene, I've got a bit of understanding and can do some basic coding. But i got a project thats baffling me.

I'm basically trying to change the token on a data string to another. I understand that LCD screens (and libraries do a lot of the dirty work for us) can receive delimiters for various commands such as linefeed, CR etc. etc. I've realised that a lot of these Displays have "cursor position" commands as well but from looking at datasheets the token used varies from screen to screen.

I have a DTE which is continually transmitting a string which uses hex 0x10 (DLE) as a token followed by two ascii digits. (Followed by the data/text that needs to be parsed)

It appears as if the token is meant to tell the LCD which line to print on. I.e cursor position.

The problem is i dont have an LCD which recognize the 0x10 as the Cursor position command nor can i find one.

I have been trying to parse the data in an arduino using the examples in the learning section but i cant seem to get them to work due to the need for a start and end char.

Is there a way for me to change the DLE token and then forward the data to a new LCD ?

My main goal is to get an LCD to display four lines dedicated to each set of values in the string. I cannot change the program on the DTE sadly.

Is there a way for me to change the DLE token and then forward the data to a new LCD ?

Yes, there is.

How to do it, specifically, depends on the code you currently have, but didn't share (and, the data, of course).

Sorry i never posted the code i used as i purely couldn’t see it working for this instance, i tried implementing this example by changing the Ifs in the example code here:

This is as far as i got that “worked”
#include <SoftwareSerial.h>
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#define rxPin 7
#define txPin 1

SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin);
#define DataString long
LiquidCrystal_I2C lcd(0x27,2,1,0,4,5,6,7); // 0x27 is the I2C bus address for an unmodified module

void setup()
lcd.setBacklight(HIGH); // NOTE: You can turn the backlight off by setting it to LOW instead of HIGH
lcd.begin(20, 4);


void serialRepeater(){
// lcd.clear();
// lcd.setCursor(0,0);
// lcd.print(“Serial repeater”);

//while (mode==3) {
while (mySerial.available())
if (mySerial.available()) Serial.write(;
if (Serial.available()>0) mySerial.write(;

// mainmenu();

void loop() {
// Serial.println(“Ready”);
lcd.setCursor (0,0);



The closest i got was to make it capable of receving the signal and pushing it on. any attempt to change it and i found adding the parseInts as with the example just caused it to fail.
Im using I2C with a “I2C Backpack” for the LCD screen to seperate the SPI being recieved.
The communication to the DTE is via RS232 and i have used a max232 chip to adjust the signal voltages accordingly.

This is the data which needs to be parsed and translated for use with the LCD.
as you can see after each 0x10 token there is 2 ascii chars: 00, 16, 32, or 48.
These appear to define which line on the display the set of data after it then prints to.


When the pre-processor gets done, this line will be


The print() method does not take a type, and you can't have a variable with the same name as a type. So, it is not at all clear what you are doing.

When you think you need pre-processor directives, you really should think again.