0

in step 5 of void Userinterface::checkSensors() an error occurs saying sensorValue does not name a type. I tried to solve it by defining sensorValue as integer by adding line of code ( int sensorValue = readSensor(); ) however, another error occured saying that 'readSensor' was not declared in this scope. Could you, please, explain how can I solve this?

Share a link to this question (includes your user id)
| edit | | close | delete |
0

Temporally, try adding just these lines to Userinterface::checkSensors():

void Userinterface::checkSensors() {
  sensorValue = analogRead(sensorPin);
  Serial.print("sensorValue="); Serial.println(sensorValue);
}

Does that work? Can you upload it and check the Serial Monitor? Does it print the value for sensorValue?

Since the variables like sensorValue are already defined in the class Userinterface (in Userinterface.h), they should be known. They are class-variables.

Share a link to this answer (includes your user id)
| edit | delete |

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.