Project works with serial and LCD, except one input?

I’ve made a project reading the frequency of a switching relay, along with the duty cycle, amps and voltage. The whole project works in in the serial monitor and the volts and amps display on the LCD.

The frequency and duty cycle don’t display at all, a constant reading of 0.00. I’ve probed the circuit and verified its operating.

I’ve attached the code, maybe there’s an issue with the pins I’m using conflicting with the LCD?

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 8, 7, 6, 5);

const byte interruptPin = 3;

int divider[6] = {
0, 1, 8, 64, 256, 1024
};

int prescaler = 5;

double count = 0;
double middle = 0;
double usage = 0;
char x = 0;

float frequency;
float duty;

int machineInput = A2;
int machineValue;
float machineOut;
float machineIn;
float machineR1 = 8660.0;
float machineR2 = 5620.0;

int currentInput = A3;
int currentValue;
float currentOut;
float currentIn;
float shunt = 0.1;

ISR(TIMER1_OVF_vect)
{

if (prescaler < 4) {
prescaler++;
}

}

void interrupt()
{

if (!x) {
count = TCNT1;
TCNT1 = 0x000;
TCCR1B = prescaler;
attachInterrupt(digitalPinToInterrupt(interruptPin), interrupt, FALLING);
}

else {
middle = TCNT1;
attachInterrupt(digitalPinToInterrupt(interruptPin), interrupt, RISING);
}

x = ~x;

}

void setup()
{

Serial.begin(57600);
lcd.begin(16, 2);

pinMode(machineInput, INPUT);
pinMode(currentInput, INPUT);

TIMSK1 = 0x01;
TCCR1A = 0x00;
attachInterrupt(digitalPinToInterrupt(interruptPin), interrupt, RISING);

}

void loop()
{

frequency = (16000000.0 / divider[prescaler] / count);
duty = (middle / count * 100);
if (frequency > 170 || frequency < 40 || duty < 30) {
frequency = 0;
duty = 0;
}

machineValue = analogRead(machineInput);
machineOut = (machineValue * 5.0) / 1024.0;
machineIn = machineOut / (machineR2 / (machineR1 + machineR2));
if (machineIn < 0.09) {
machineIn = 0;
}

currentValue = analogRead(currentInput);
currentOut = (currentValue * 5.0) / 1024.0;
currentIn = currentOut / (2 * shunt);
if (currentIn < 0.09) {
currentIn = 0;
}

Serial.println(frequency, 0);
Serial.println(duty, 0);
Serial.println(machineIn, 1);
Serial.println(currentIn);
lcd.setCursor(0, 0);
lcd.print(frequency, 0);
lcd.setCursor(4, 0);
lcd.print(“hZ”);
lcd.setCursor(0, 1);
lcd.print(duty, 0);
lcd.setCursor(4, 1);
lcd.print("%");
lcd.setCursor(10, 0);
lcd.print(machineIn, 1);
lcd.setCursor(15, 0);
lcd.print(“V”);
lcd.setCursor(10, 1);
lcd.print(currentIn);
lcd.setCursor(15, 1);
lcd.print(“A”);

delay(500);

if (prescaler > 1) {
if (usage < 0.15) {
prescaler–;
delay(200);
}
}

}

I ran a simple pulseIn code on the same input and it displays correctly, it must be something in the code?

I removed

if (frequency > 170 || frequency < 40 || duty < 30) {
frequency = 0;
duty = 0;
}

only to find out, the display was reading 0.00 because for some reason its displaying very high numbers on the display for some reason.