Print serial monitor on lcd

hello arduino forum

I am a complete noob to arduino. I want to print the data from the serial monitor to my lcd.
I have a 16x2 lcd (Gleichmann GE-C1602B-TMI-JT/R). I am using the arduino due. Here is my code and my wiring.

int fanPulse = 0;
unsigned long pulseDuration;

void setup()
{
int pwmPin = 9; 
Serial.begin(9600);
pinMode(fanPulse, INPUT);
digitalWrite(fanPulse,HIGH);
}

void readPulse() {
pulseDuration = pulseIn(fanPulse, LOW);
double frequency = 1000000/pulseDuration;

Serial.print("pulse duration:");
Serial.println(pulseDuration);

Serial.print("time for full rev. (microsec.):");
Serial.println(pulseDuration*2);
Serial.print("freq. (Hz):");
Serial.println(frequency/2);
Serial.print("RPM:");
Serial.println(frequency/2*60);

}

void loop()
{
analogWrite(3,20);
delay(5000);
readPulse();
analogWrite(3,50);
delay(5000);
readPulse();
analogWrite(3,100);
delay(5000);
readPulse();
analogWrite(3,200);
delay(5000);
readPulse();
analogWrite(3,255);
delay(5000);
readPulse();
}

Use lcd.print instead of Serial.print.

Use lcd.print instead of Serial.print.

But don't use lcd.println instead of Serial.println.

Actually you can use it, and it will compile, but you won't like the results.

Don

I have updated my code but i still cant get it to work.

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
int fanPulse = 0;
unsigned long pulseDuration;

void setup()
{
lcd.begin(16, 2);
int pwmPin = 9; 
Serial.begin(9600);
pinMode(fanPulse, INPUT);
digitalWrite(fanPulse,HIGH);
}

void readPulse() {
pulseDuration = pulseIn(fanPulse, LOW);
double frequency = 1000000/pulseDuration;

Serial.print("pulse duration:");
Serial.println(pulseDuration);

Serial.print("time for full rev. (microsec.):");
Serial.println(pulseDuration*2);
Serial.print("freq. (Hz):");
Serial.println(frequency/2);
lcd.print("RPM:");
Serial.println(frequency/2*60);

}

void loop()
{
analogWrite(3,20);
delay(5000);
readPulse();
analogWrite(3,50);
delay(5000);
readPulse();
analogWrite(3,100);
delay(5000);
readPulse();
analogWrite(3,200);
delay(5000);
readPulse();
analogWrite(3,255);
delay(5000);
readPulse();
lcd.setCursor(0, 1);
lcd.print(millis() /1000);
}

What does that mean “can’t get it to work”? Quality of assistance is directly proportional to quality of information provided.

Groove:
Use lcd.print instead of Serial.print.

I'll append an instruction here, replace all instances of serial.print with lcd.print, you only replaced one. Does the LCD just say RPM?
If you want to see data on LCD and the serial you'll have to use both separately or stuff all the things you want to say in a string then call each one once. (?)