convert the code from LiquidCrystal_I2C.h to LiquidCrystal.h

i found this code below and i want to use it on lcd 16*2 without I2C
i changed things but i still got errors
this is the "original one"

/*
 * Displays text sent over the serial port (e.g. from the Serial Monitor) on
 * an attached LCD.
 */
#include <Wire.h>

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

LiquidCrystal_I2C lcd(0x3F,16,2);

int led1 = 8;
float raw;

byte bl[8] = {
  B00000,
  B00000,
  B00000,
  B00000,
  B00000,
  B00000,
  B00000,
};

void setup()
{
  pinMode(led1, OUTPUT);
  lcd.init();                      // initialize the lcd
  lcd.backlight();
  Serial.begin(9600);
  lcd.createChar(1, bl);
  lcd.createChar(2, bl);
  lcd.createChar(3, bl);
  lcd.createChar(4, bl);
  lcd.setCursor(0,0);
  lcd.print("dd-wrt - powered");
  lcd.setCursor(0,1);
  lcd.print("ASUS  WL500gP v2");
}

void loop()
{
 
  int charcount;
  boolean secondline;
  if (Serial.available()) {
    delay(200);
    lcd.clear();
    charcount = 0;
    secondline = false;
    while (Serial.available() > 0) {
      if (charcount > 15 && secondline == false ) {
        lcd.setCursor(0,1);
        secondline = true;
      }
      char inChar = (char)Serial.read();
      if (inChar != '\0') {
      lcd.write(inChar);
      }
      if (inChar == '\1') {
      lcd.backlight();
      }
      if (inChar == '\2')
       {
      lcd.noBacklight();
       }
       if (inChar == '\3') {
      digitalWrite(led1, HIGH);
      }
       if (inChar == '\4'){
      digitalWrite(led1, LOW);
       }
      charcount++;
    }
  }
 }

and i change it to this

// include the library code:
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
float raw;
byte bl[8] = {
  B00000,
  B00000,
  B00000,
  B00000,
  B00000,
  B00000,
  B00000,
};

void setup(){
   lcd.begin(16, 2);
  Serial.begin(9600);
  lcd.createChar(1, bl);
  lcd.createChar(2, bl);
  lcd.createChar(3, bl);
  lcd.createChar(4, bl);
  lcd.setCursor(0,0);
  lcd.print("dd-wrt - powered");
  lcd.setCursor(0,1);
  lcd.print("cisco e900");
}
void loop()
{
  int charcount;
  boolean secondline;
  if (Serial.available()) {
    delay(200);
    lcd.clear();
    charcount = 0;
    secondline = false;
    while (Serial.available() > 0) {
      if (charcount > 15 && secondline == false ) {
        lcd.setCursor(0,1);
        secondline = true;
      }
      char inChar = (char)Serial.read();
      if (inChar != '\0') {
      lcd.write(inChar); 
    }
  }
 }

i am using this code to show up data from a router with dd-wrt
i finished the code on my router and everything work great
i still have no data on my display, i think i removed something important from the original code
is my second code right?!

What is the LCD that you are using?
Normally I use:

LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

with a LCD shield and an Arduino MEGA.

this one without I2C
here
i test it before with "hello world" on same pins work without any problem

narzan:
this one without I2C
here
i test it before with "hello world" on same pins work without any problem

So, the problem can be the communication. For example, you miss the line:

      charcount++;

How you did you test if the program is working?

How you did you test if the program is working?

i test my lcd to be sure if there is any lose soldering, also i made other test on my linux and shells commands on my router, my problem from arduino code,
other thing why i must cut TX & RX wires every-time !!!! i cant upload anything also with the router off !! :cry:
i will check this charcount++;

narzan:
i test my lcd to be sure if there is any lose soldering, also i made other test on my linux and shells commands on my router, my problem from arduino code,
other thing why i must cut TX & RX wires every-time !!!! i cant upload anything also with the router off !! :cry:
i will check this charcount++;

Why you don't simply test the program with the serial monitor? You download the sketch to the Arduino and then you write some text in the serial monitor and see what happens. You can also write back the text to the serial line to ensure that you are receiving the text well.

LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

oh my god! :astonished:

LiquidCrystal lcd(7, 8, 9, 10, 11,12)

that was my problem :astonished: :astonished: :astonished: :astonished: :roll_eyes: