help with code to replace input from pot to a rotary encoder

im building a hvac thermostat controller and currently im using a 10k pot to set the desired temp on A0 pin. the only one's i have are single turn which means very small movements to set temp.
i do have a few rotary encoders begging to have some solder on the legs.

how would i modify the current code below to accept input from an encoder.....

/* A fair portion of the code here is from Arduinotronics and I would have been lost with out it. This is my first “big” Arduino project. So, there is probably a ton of things that can be improved on and tweeked. I would love to know your thoughts and see your improvements! If you would like to share your thoughts with me on this please email me at modsbyus at modsbyus dot com and make the subject line RE: Arduino Thermostat Thoughts, or write a comment on the tutorial at http://www.modsbyus.com/diy-arduino-thermostat. Required library for the DS18B20 can be downloaded here.. http://192.40.125.129/public.php?service=files&file=/admin/files/Modsbyus/libraries.rar/ */
#include <OneWire.h> /*This temperature sensor requires a 4.7k Ohm resistor across its pins 2 and three!!!! */
#include <DallasTemperature.h>
#include <LiquidCrystal.h>
int sensorPin = A0; // select the input pin for the 10K potentiometer
int sensorValue = 0; // variable to store the value coming from the sensor
int setTemp = 0; // variable to store temp desired
int SSRCPin = 5; //Turn on A/C unit
int SSRHPin = 6; //Turn on heat (electric or gas)
int hcLED = 4; //indicator for Cooling mode
int SwitchPin = 1; // To switch between Cooling and Heating
int SSRFan = 7; // To turn on and off the air handler fan
float currentTemp = 0; //Store the current tempurature
// LCD Wires from LCD/to Arduino and other components
// 1 to GND
// 2 to 5V
// 3 to Trimmer Pot Reference Pin
// 4 to Arduino Pin 9
// 5 to GND
// 6 to Arduino Pin 10
// 11 to Arduino Pin 11
// 12 to Arduino Pin 12
// 13 to Arduino Pin 13
// 14 to Arduino Pin 8
// 15 to 5V
// 16 to GND
//Heat relay to Arduino pin 4
//Cooling relay to Arduino pin 5
//Fan relay to Arduino pin 6
//LEDs relay to Arduino pin 7
//DS18B20 to Arduino pin 2
//Heat/Cool switch to Arduino pin 1
LiquidCrystal lcd(9, 10, 11, 12, 13, 8);
/*This temperature sensor requires a 4.7k Ohm resistor across its pins 2 and three!!!! Thats the middle pin and the VDD pin */
// Data wire is plugged into pin 2 on the Arduino
#define ONE_WIRE_BUS 2
// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
DeviceAddress insideThermometer = { 0x28, 0x3F, 0x2B, 0x77, 0x03, 0x00, 0x00, 0x95 };
// DeviceAddress outsideThermometer = { 0×28, 0×20, 0×04, 0xA8, 0×02, 0×00, 0×00, 0x4D };
void setup(void)
{
// Start up the library
sensors.begin();
// set the resolution to 9 bit (good enough?)
sensors.setResolution(insideThermometer, 9);
// sensors.setResolution(outsideThermometer, 9);
lcd.begin(16,2); // columns, rows. use 16,2 for a 16×2 LCD, etc.
pinMode(SSRFan, OUTPUT); //set air handler fan pin as output
digitalWrite(SSRFan, LOW);//Set the fan relay pin normally low (off)
pinMode(SSRHPin, OUTPUT);//Set the heat relay pin as an output
digitalWrite(SSRHPin, LOW);//Set the heat relay pin as normally low (off)
pinMode(SSRCPin, OUTPUT);//Set the cooling relay pin as an output
digitalWrite(SSRCPin, LOW);//Set the cooling relay pin as normally low (off)
pinMode(hcLED, OUTPUT);//Set the indicator LED pin as an output
digitalWrite(hcLED, LOW);//Set the LED indicator pin as normally low (cooling indication)
pinMode(SwitchPin, INPUT);//Set the switch pin as an input
}
void printTemperature(DeviceAddress deviceAddress)
{
sensors.requestTemperatures(); //Get temperature from DS18B20
float tempC = sensors.getTempC(deviceAddress);
if (tempC == -127.00) {
lcd.print("Error");
} else {
// lcd.print(tempC);
// lcd.print(“/”);
currentTemp = (DallasTemperature::toFahrenheit(tempC));
lcd.print(currentTemp);
}
}
void loop(void)
{
delay(500);
sensorValue = analogRead(sensorPin); //Set the variable ‘sensorValue’ as and analog read of the sensor pin
setTemp = sensorValue / 10.24; //Gives us a set temp range between 0 and 99 degrees
lcd.clear(); // start with a blank screen
lcd.setCursor(0,0); //Set the cursor to the 1st position on the 1st line
lcd.print("Current:"); //Print the word ‘Current:’
lcd.setCursor(0,1);//Set the cursor to the 1st position on the second line
lcd.print("Set:"); //Print the word ‘Set:’
//lcd.setCursor(0,3);
//lcd.print(“Heat: “);
 
lcd.setCursor(8,0);// Set the cursor to position 8 on the 1st line
printTemperature(insideThermometer);//Print the temperature read from the DS18B20
lcd.setCursor(6,1);//Set the cursor to the position 6 on the 2nd line
lcd.print(setTemp); //Print the value read from the potentiometer
//lcd.setCursor(7,3);
//lcd.print(heat);
//Cooling Mode
int val = digitalRead(SwitchPin) ;// val represents digitalRead(SwitchPin);
/* If the value of is equal to 1 (high) then make hcLED low (off) which sets the relay in a normally closed state. Hence, turning on the blue LED. */
if (val == 1)
{
digitalWrite(hcLED, LOW);//Set the heating/cooling LED indicator to LOW if ‘val’ is equal to 1
}
/* If the SwitchPin reads 1 and the current temperature is greater than the set temperature (if its hot) turn on the A/C and internal fan */
if (val == 1 && (currentTemp > setTemp))
{
digitalWrite(SSRFan, HIGH);//Set the fan relay high
digitalWrite(SSRHPin, LOW);//Set the heat relay low
digitalWrite(SSRCPin, HIGH);//Set the cooling relay high
}
/* Otherwise, if the SwitchPin reads 1 and the current temperature is less than the set temperature (the set temperature has been reached), turn off the A/C and internal fan */
else if (val == 1 && (currentTemp < setTemp))
{
digitalWrite(SSRCPin, LOW);//Set the cooling relay low
digitalWrite(SSRFan, LOW);//Set the fan relay low
}
// Heating Mode
/* If the value of is 0 then make hcLED HIGH (on) which sets the relay in a normally open state. Hence, turning on the RED LED */
if (val == 0)
{
digitalWrite(hcLED, HIGH);//Set the heating/cooling led high
}
/* If the SwitchPin reads 0 and the current temperature is less than the set temperature (if its cold) turn on the HEAT and internal fan */
if (val == 0 && (currentTemp < setTemp))
{
digitalWrite(SSRFan, HIGH);//Set the fan relay high
digitalWrite(SSRCPin, LOW);//Set the cooling relay low
digitalWrite(SSRHPin, HIGH);//Set the heat relay high
}
/* If the SwitchPin reads 0 and the current temperature is greater than the set temperature (the set temperature has been reached) turn off the HEAT and internal fan */
else if (val == 0 && (currentTemp > setTemp))
{
digitalWrite(SSRHPin, LOW);//Set the heat relay low
digitalWrite(SSRFan, LOW);//Set the fan relay low
}
}

the encoders are BOURNS PEC12R-4050F-S0012 if it matters

Is it possible to set the temp range in the sketch from something like 65° to 85° so that the pot wouldn't be controlling such a broad range ?
GD

great idea..

i think this should give me a range of 25 degrees between 60 - 85

setTemp = sensorValue / 40.96+60;

thank you.
sometimes you stare at something for so long you overlook the obvious