How to add code with your question?

I have an if statment:
"if(millis()-GBL_DHT_LastSampleTime > GBL_DHT_SamplePeriodMs || firstTime += 1) {"
and I getting an error:
"lvalve required as left operand of assignment"
the error is for the "firstTime = 1"

Is 'firstTime' a variable you can write to?

Did you mean "firstTime == 1" to test the value rather than "firstTime += 1" to add 1 to it?

What are you trying "firsttime" to do? Are you meaning to increase it as a counter? Also, ensure your parenthesis surround the data you want evaluated... I took a guess and added enclosing parenthesis twice, indicating "IF ((THIS) OR (THAT)) then {DO THE THING}"

if((millis()-GBL_DHT_LastSampleTime > GBL_DHT_SamplePeriodMs) || (firstTime += 1))

LVALUE means one side does not evaluate (be meaningful to the compiler).

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.