new lcd old code

Hi guys, I am very new to arduino as well as to this forum…
I have been running a boost program with the arduino on my car, but and theres always a but,
I have purchased another lcd due to trying to match the oem look but the code obviously wont work with that one as the old lcd had 3 wires and the new
one has Pinout is standard HD44780 except for the extra 2 pins for the RGB backlight. The original code was written for me
as the code writing I am unable to do. Is there anyone on here able to or willing to help me rewrite this code…

// Arduino boost gauge project
// Uses Freescale MPX4250AP MAP sensor on Analog port 0 and SparkFun 16×2 Serial LCD display
// Push button on D2 pulled to 5V, ground to reset peak memory

int mapsen = 0; // Set MAP sensor input on Analog port 0
float boost = 0; // Set boost value to 0
float mapval = 0; // Set raw map value to 0
volatile float peakboost = 0; // Set peak memory to 0

void setup()
{
attachInterrupt (0, preset, LOW); // defines reset interrupt on D2
Serial.begin(9600); // Open serial port
Serial.write(254); // SerLCD instruction
Serial.write(01); // Clear display
Serial.write(254); // SerLCD instruction
Serial.write(128); // “Powered by:” on first line, left align
Serial.print("Seat Leon");
Serial.write(254); // SerLCD instruction
Serial.write(197); // “NSFabrication” on second line, left align
Serial.print("Cupra 1.8T");
delay (4000); // Display splash screen for 2 seconds
Serial.write(254); // SerLCD instruction
Serial.write(01); // Clear display
Serial.write(254); // SerLCD instruction
Serial.write(128); // “MAP:” at top right of display
Serial.print("BOOST");
Serial.write(254); // SerLCD instruction
Serial.write(140); // “PSI” three digits to the right of “MAP:”
Serial.print("PSI");
Serial.write(254); // SerLCD instruction
Serial.write(192); // “Peak:” at bottom right of display
Serial.print("PEAK");
Serial.write(254); // SerLCD instruction
Serial.write(204); // “PSI” left of peakboost
Serial.print("PSI");
}

void loop()
{
mapval= analogRead(mapsen); //Reads the MAP sensor raw value on analog port 0
boost = (mapval*(.00488)/(.022)*(0.145)-14.5); //Converts raw MAP value to PSI and accounts for atomospheric pressure

if (boost > peakboost) // If current boost is higher than peak, store in peak memory
{
peakboost = boost ;  // Store current boost in peak memory
}

if (peakboost <= 0) // Shifts peak value 1 character to the right if < 10PSI
{
Serial.write(254); // SerLCD instruction
Serial.write(197); // Peak display after “Peak:”
Serial.print(peakboost,1); //peak to 1 decimal
}
else
{
Serial.write(254); // SerLCD instruction
Serial.write(197); // Go to position 22
Serial.write(32); // Load clear bit at position 22
Serial.write(254); // SerLCD instruction
Serial.write(198); // Go to position 22
Serial.write(32); // Load clear bit at position 23
Serial.write(254); // SerLCD instruction
Serial.write(199); // Go to position 22
Serial.write(32); // Load clear bit at position 24
Serial.write(254); // SerLCD instruction
Serial.write(200); // Go to position 22
Serial.write(32); // Load clear bit at position 25
Serial.write(254); // SerLCD instruction
Serial.write(201); // Go to position 22
Serial.write(32); // Load clear bit at position 26
Serial.write(254); // SerLCD instruction
Serial.write(202); // Go to position 22
Serial.write(32); // Load clear bit at position 26
Serial.write(254); // SerLCD instruction
Serial.write(198); // Peak display after “Peak:”
Serial.print(peakboost,1); //peak to 1 decimal
}
if (boost <= 0) //Shifts the MAP value 1 character to the right if < 10PSI
{
Serial.write(254); // SerLCD instruction
Serial.write(133); // boost after “MAP:”
Serial.print(boost,1); //boost to 1 decimal
}
else
{
Serial.write(254); // SerLCD instruction
Serial.write(133); // Go to position 6
Serial.write(32); // Load clear bit at position 4
Serial.write(254); // SerLCD instruction
Serial.write(134); // Go to position 7
Serial.write(32); // Load clear bit at position 4
Serial.write(254); // SerLCD instruction
Serial.write(135); // Go to position 8
Serial.write(32); // Load clear bit at position 4
Serial.write(254); // SerLCD instruction
Serial.write(136); // Go to position 9
Serial.write(32); // Load clear bit at position 4
Serial.write(254); // SerLCD instruction
Serial.write(137); // Go to position 10
Serial.write(32); // Load clear bit at position 4
Serial.write(254); // SerLCD instruction
Serial.write(138); // Go to position 11
Serial.write(32); // Load clear bit at position 4
Serial.write(254); // SerLCD instruction
Serial.write(134); // boost after “MAP:”
Serial.print(boost,1); // boost to one decimal
}
delay(100); // prevents LCD display from ghosting. Lower number refreshes faster, higher number has less ghosting on slow LCD’s
}

void preset() //peak reset if D2 goes low
{
peakboost = boost; //sets peakboost to current boost reading, resetting the peak memory
}

I apologise if Im in the wrong place with this or if its a question thats not allowed.
I appreciate any help with this tyvm.

Just use the LCD library. The examples that come with the Arduino IDE should give you all the information you need.

majenko: Just use the LCD library. The examples that come with the Arduino IDE should give you all the information you need.

I have been reading all the forums for the past couple of months and the websites that help, but it is still a very foreign language to me. Ive never understood programming, sad but true, but tx anyway, I think i may have to keep the old code with the old lcd.

Would this work or am I all wrong…

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int mapsen = 0; // Set MAP sensor input on Analog port 0
float boost = 0; // Set boost value to 0
float mapval = 0; // Set raw map value to 0
volatile float peakboost = 0; // Set peak memory to 0

void setup() {
  // set up the LCD's number of columns and rows: 
  lcd.begin(16,2);
  // set the cursor to (0,0):
  lcd.setCursor(0, 0);
  lcd.print("Seat Leon");
  lcd.setCursor(0, 1);
  lcd.print("Cupra 1.8t");
  delay (4000);
  // clear screen for the next loop:
  lcd.clear();
  // set the cursor to (0,0):
  lcd.setCursor(0, 0);
  lcd.print("Boost");
  lcd.setCursor(14, 0);
  lcd.print("PSI");
  lcd.setCursor(0, 1);
  lcd.print("Peak");
  lcd.setCursor(14, 1);
  lcd.print("PSI");
}


void loop() {
  mapval= analogRead(mapsen); //Reads the MAP sensor raw value on analog port 0
  boost = (mapval*(.00488)/(.022)*(0.145)-14.5); //Converts raw MAP value to PSI and accounts for atomospheric pressure

  if (boost > peakboost) // If current boost is higher than peak, store in peak memory
  {

    peakboost = boost ;  // Store current boost in peak memory
  }

  if (peakboost <= 0) // Shifts peak value 1 character to the right if < 10PSI

  {
    lcd.write(254); // SerLCD instruction
    lcd.write(197); // Peak display after “Peak:”
    lcd.print(peakboost,1); //peak to 1 decimal
  }
  else
  {
    lcd.write(254); // SerLCD instruction
    lcd.write(197); // Go to position 22
    lcd.write(32); // Load clear bit at position 22
    lcd.write(254); // SerLCD instruction
    lcd.write(198); // Go to position 22
    lcd.write(32); // Load clear bit at position 23
    lcd.write(254); // SerLCD instruction
    lcd.write(199); // Go to position 22
    lcd.write(32); // Load clear bit at position 24
    lcd.write(254); // SerLCD instruction
    lcd.write(200); // Go to position 22
    lcd.write(32); // Load clear bit at position 25
    lcd.write(254); // SerLCD instruction
    lcd.write(201); // Go to position 22
    lcd.write(32); // Load clear bit at position 26
    lcd.write(254); // SerLCD instruction
    lcd.write(202); // Go to position 22
    lcd.write(32); // Load clear bit at position 26
    lcd.write(254); // SerLCD instruction
    lcd.write(198); // Peak display after “Peak:”
    lcd.print(peakboost,1); //peak to 1 decimal
  }
  if (boost <= 0) //Shifts the MAP value 1 character to the right if < 10PSI
  {
    lcd.write(254); // SerLCD instruction
    lcd.write(133); // boost after “MAP:”
    lcd.print(boost,1); //boost to 1 decimal
  }
  else
  {
    lcd.write(254); // SerLCD instruction
    lcd.write(133); // Go to position 6
    lcd.write(32); // Load clear bit at position 4
    lcd.write(254); // SerLCD instruction
    lcd.write(134); // Go to position 7
    lcd.write(32); // Load clear bit at position 4
    lcd.write(254); // SerLCD instruction
    lcd.write(135); // Go to position 8
    lcd.write(32); // Load clear bit at position 4
    lcd.write(254); // SerLCD instruction
    lcd.write(136); // Go to position 9
    lcd.write(32); // Load clear bit at position 4
    lcd.write(254); // SerLCD instruction
    lcd.write(137); // Go to position 10
    lcd.write(32); // Load clear bit at position 4
    lcd.write(254); // SerLCD instruction
    lcd.write(138); // Go to position 11
    lcd.write(32); // Load clear bit at position 4
    lcd.write(254); // SerLCD instruction
    lcd.write(134); // boost after “MAP:”
    lcd.print(boost,1); // boost to one decimal
  }
  delay(100); // prevents LCD display from ghosting. Lower number refreshes faster, higher number has less ghosting on slow LCD’s
}



void preset() //peak reset if D2 goes low
{
  peakboost = boost; //sets peakboost to current boost reading, resetting the peak memory
}