Problem with GPIO 5 (D1) output mode high or low

I'm trying to get a relay to function to turn on and off power to a stepper motor to open a vent. I believe I'm using the correct code however when I print the state of the pin it always returns the pin number. I have other pins that are working correctly so I'm confused on what the issue is.

I'm using

const int relayPin = 5;
digitalWrite (relayPin, HIGH);

the full code below....

#include "DHTesp.h"
#include <Stepper.h>
#define STEPS 200
Stepper stepper(STEPS, 15, 13);
#define motorInterfaceType 1

// defines pins numbers
const int LimitSwitch_Open_Pin = 2;
const int LimitSwitch_Closed_Pin = 14;
const int relayPin = 5;

DHTesp dht;
void setup() {
Serial.begin(9600);
stepper.setSpeed(500); // Sets stepper speed
dht.setup(0, DHTesp::DHT11); // Connect DHT sensor to GPIO 0
// Sets pinModes
pinMode(LimitSwitch_Open_Pin , INPUT);
pinMode(LimitSwitch_Closed_Pin , INPUT);
pinMode(relayPin, OUTPUT);
digitalWrite(relayPin, HIGH);
}

void loop() {

delay(dht.getMinimumSamplingPeriod());
float humidity = dht.getHumidity();
float temperature = dht.getTemperature();
Serial.println("Temperature");
Serial.println(temperature);
Serial.println(humidity);
float openSw = digitalRead( LimitSwitch_Open_Pin);
float closedSw = digitalRead( LimitSwitch_Closed_Pin);
Serial.print("Closed endsop State=");
Serial.println(closedSw);
Serial.print("Open endstop State=");
Serial.println(openSw);
Serial.print("RelayPin State=");
Serial.println(relayPin);
if (temperature >= 22 && openSw == HIGH) {
digitalWrite(relayPin, LOW);
delay(200);
ventOpen();
}
else {
digitalWrite(relayPin, HIGH);
}
if (temperature <= 21 && closedSw == HIGH) {
digitalWrite(relayPin, LOW);
delay(200);
ventClose();
} else {
digitalWrite(relayPin, HIGH);
}
}

void ventOpen() {
float openSw = digitalRead(LimitSwitch_Open_Pin);
while(digitalRead(LimitSwitch_Open_Pin) == HIGH) {
stepper.step(-10);
yield();
}
Serial.println("Vent Open!");
}

void ventClose() {
float openSw = digitalRead(LimitSwitch_Closed_Pin);
while(digitalRead(LimitSwitch_Closed_Pin) == HIGH) {
stepper.step(10);
yield();
}
Serial.println("Vent Closed!");
}

Compare and contrast:

 float closedSw = digitalRead( LimitSwitch_Closed_Pin);
  Serial.print("Closed endsop State=");
  Serial.println(closedSw);
  Serial.print("RelayPin State=");
  Serial.println(relayPin);

Using a float to store the state is a bit odd though.

If you are talking about the statement

Serial.println(relayPin);

it prints really the pin number. If you will see the pin state you must get the state and print it.

**Serial.println(digitalRead(relayPin)); **

I have it working now thanks to the forum and switched "float" to "byte"

thanks to all!