If you want to avoid thisif....(stateHeaterD = LOW)
then try to develop the habit of writing comparisons with the constant first
if (LOW == stateHeaterD) will keep the compiler happy, but if you forget how a comparison should look, then if (LOW = stateHeaterD) will upset the compiler, and you'll get an error.
OTOH, if you remember to do that, you'll remember how to write comparisons correctly.
"uint8_t" is a portable version of the Arduino "byte" data type.