Counters not working

Good evening,

I am that consists of a temp sensor, a fan, a lightbulb (as a heater) and lights (that turn on and off with a set time.

I tried making the lights turn on and off by using 2 counters one names"tensec" and one named "tenmin". i have an issue cause the counters are not incrementing. can anyone tell me what is wrong with my code?

Also during testing, I changed the delay from ten seconds to 1 second but the serial monitor still printed every 10 seconds did this ever happen to you?

Thanks

#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 3
float humi;
float tempC;
float tempF;
int fan = 5;
int heat =8;
int light =11;
int htct =0;
int clct=0;
int tensec;
int tenmin;
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

void setup() {
Serial.begin(9600);
pinMode(heat, OUTPUT);
pinMode(fan, OUTPUT);
pinMode(light, OUTPUT);
sensors.begin();
}

void loop() {
sensors.requestTemperatures();
// Fetch the temperature in degrees Celsius for device index:
float tempC = sensors.getTempCByIndex(0); // the index 0 refers to the first device
tempcont();
sm();
delay(1000);
tensec = tensec++;

// condition to change the air inside the container every time the tensec counter reaches 60 (every 10 minutes)
if(tensec = 60){
airchange();
tensec=0;
tenmin = tenmin++;
}
if(tenmin <= 120){
digitalWrite(light , HIGH);
}

if(tenmin >=121 && tenmin < 144){
digitalWrite(light , LOW);
}

if(tenmin = 144){
tenmin=0;
}
}
// subroutine that monitors the tempreture and acts acocordingly
void tempcont(){
if(tempC >= 25){
lwtemp();
}
if(tempC <= 18){
//hitemp();
}
}
//subroutine that prints on the serial monitor
void sm(){
if (isnan(tempC)) {
Serial.println("Failed to read from temp sensor!");
} else {
Serial.print("Temperature: ");
Serial.print(tempC);
Serial.print("°C ~ ");
Serial.print(" | ");
Serial.print("heat:");
Serial.print(htct);
Serial.print(" cooling:");
Serial.println(clct);
Serial.println(tenmin);
Serial.println(tensec);
}
}
// subroutine that lowers the tempreture by turining on the fan
void lwtemp(){
digitalWrite(fan ,HIGH);
delay(8000);
digitalWrite(fan ,LOW);
clct++;
}
//subroutine that turns up the heat bu turining on a lightbulb and the fan
void hitemp(){
digitalWrite(heat ,HIGH);
digitalWrite(fan ,HIGH);
delay(8000);
digitalWrite(heat ,LOW);
digitalWrite(fan ,LOW);
htct++;
}
// subroutine that changes the air by turining on the fan for 6 seconds
void airchange(){
digitalWrite(fan ,HIGH);
delay(6000);
digitalWrite(fan ,LOW);
}

Can you explain the thought process that leads you to classify this as an introductory tutorial?

Please remember to use code tags when posting code

Oops (more than once)

if(xxxxx=yyy) means that you assign the value of yyy to xxxx..... if you want to know if the value of xxxx is yyy, then you use a double = ....
like: if(xxxx==yyy){.....}
believe me, i had bounced my head more than once with it..

And if you put the constant on the left side it may look strange but you will get an error message. (Which you can then post and ask what it means - rather than trying to figure it out)

Thank you very very much. that was the problem with the tensec counter.
now the tenmin counter is not working

Hi
and where is the 10 minute counter routine in your code?

It would help if you posted your new code

@79461766

Your post was MOVED to its current location as it is more suitable.

Could you also take a few moments to Learn How To Use The Forum.

Other general help and troubleshooting advice can be found here.

It will help you get the best out of the forum in the future.

thank you very much, I did not know that as I am a beginner

This operation is not valid and produces undefined results.

To increment a variable, use:
tensec++;
or
++tensec;
or
tensec += 1;
or
tensec = tensec + 1;

Same for "tenmin = tenmin++;"