Incorporating LCD display with PID code

Hey all,

I want to include an LCD screen into my code but I don’t know how to do it. Basically I want to be able to review an LM35 temperature input (degrees C), the set point temperature of the PID and then also (if possible) the power usage/ current intensity.

The screen will be a simple 16x2 LCD with blue backlight with white text and apparently uses standard 4 Bit Arduino LCD Library.

Here’s my code:

/********************************************************
 * PID Basic Example
 * Reading analog input 0 to control analog PWM output 3
 ********************************************************/

#include <PID_v1.h>

//Define Variables we'll be connecting to
double Setpoint, Input, Output;

//Specify the links and initial tuning parameters
PID myPID(&Input, &Output, &Setpoint,2,5,3, REVERSE);

void setup()
{
  //initialize the variables we're linked to
  Input = analogRead(0);
  Setpoint = 20;
  Serial.begin(9600);

  //turn the PID on
  myPID.SetMode(AUTOMATIC);
}

void loop()
{
  Input = analogRead(0);
  Input = (5.0 * Input * 100.0)/1024.0;  
  myPID.Compute();
  analogWrite(3 && 13,Output);
  Serial.print(Input); Serial.println(Output);
}

but I don't know how to do it.

The fact that there is PID involved in the process is completely irrelevant. You have some information that you want to display. Connect the LCD, create an instance of the class, and write to the LCD.

There are examples with the LCD library to illustrate that the LCD works. Use the same techniques in those examples.

Look at the Liquid Crystal Library section on the tutorial page, right hand column, about half way down

Edit: and as PaulS says, it’s a walk in the park