Thanks for the help. I am certainly going to try and use the simple example first, but I did cobble together something that I might could use to at least test my heating element/SSR etc. My temp sensors won't be arriving until next week it looks like.
I'm not sure why I was unable to set those pin modes, if I uncomment them I get an error message as follows:
Arduino: 1.6.6 (Windows 7), Board: "Arduino/Genuino Uno"
C:\Users\Mauser\Documents\Arduino\LCDPIDTEMP\LCDPIDTEMP.ino: In function 'void setup()':
LCDPIDTEMP:49: error: invalid conversion from 'const char*' to 'uint8_t {aka unsigned char}' [-fpermissive]
pinMode (PIN_INPUT, "INPUT");
^
In file included from sketch\LCDPIDTEMP.ino.cpp:1:0:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:125:6: error: initializing argument 2 of 'void pinMode(uint8_t, uint8_t)' [-fpermissive]
void pinMode(uint8_t, uint8_t);
^
LCDPIDTEMP:50: error: invalid conversion from 'const char*' to 'uint8_t {aka unsigned char}' [-fpermissive]
pinMode (PIN_OUTPUT, "OUTPUT");
^
In file included from sketch\LCDPIDTEMP.ino.cpp:1:0:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:125:6: error: initializing argument 2 of 'void pinMode(uint8_t, uint8_t)' [-fpermissive]
void pinMode(uint8_t, uint8_t);
^
exit status 1
invalid conversion from 'const char*' to 'uint8_t {aka unsigned char}' [-fpermissive]
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
One other thing that is confusing is the "&" in front of the variables in the PID setup.
// PID library
#include <PID_v1.h>
// Wire library needed for LCD
#include <Wire.h>
//NewLCD library
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
//One Wire library
// Downloaded from https://github.com/PaulStoffregen/OneWire
#include <OneWire.h>
// Dallas library from the Arduino Temp Control Library
//https://github.com/milesburton/Arduino-Temperature-Control-Library
#include <DallasTemperature.h>
// Stuff for the LCD
#define I2C_ADDR 0x3F // My LCD's address
// no backlight pin connected
#define En_pin 2
#define Rw_pin 1
#define Rs_pin 0
#define D4_pin 4
#define D5_pin 5
#define D6_pin 6
#define D7_pin 7
int n = 1;
LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);
// PID variables and setup
#define PIN_INPUT 2 // I changed it from 0 to 2 since that is where the temp sensors are going to be?
#define PIN_OUTPUT 13 //using onboard LED for now
//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,1, DIRECT);
// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
void setup()
{
// set pins This would not compile
// pinMode (PIN_INPUT, "INPUT");
// pinMode (PIN_OUTPUT, "OUTPUT");
// starts LCD, 20x4 display
lcd.begin (20,4);
// start the temp sensors
sensors.begin();
Serial.begin(9600);
//Display Splash Screen
lcd.home (); // go home
lcd.print(" Petit Jean");
lcd.setCursor (5,1);
lcd.print("Home");
lcd.setCursor (4,2);
lcd.print("Brewery");
// Variables for the PID controller
Setpoint = 165; // This would be inputed by the user, hard coded number for now
Input = analogRead(PIN_INPUT);
//turn the PID on
myPID.SetMode(AUTOMATIC);
}
void loop()
{
// Get temps and display them on the LCD
sensors.requestTemperatures();
int Ambient = sensors.getTempFByIndex(0);
int Kettle = sensors.getTempFByIndex(1);
lcd.setCursor (1,3);
lcd.print(Ambient);
lcd.setCursor (1,4);
lcd.print (Kettle);
delay(100);
// called once every loop for PID to continue
myPID.Compute();
analogWrite(PIN_OUTPUT, Output);
lcd.setCursor(10,4);
lcd.print(PIN_OUTPUT);
}