I am running into an error "cmdTemperature was not declared in this scope"
I thought it was a spelling error, but I am not finding the type, so I was wondering if something else could be causing this error.
#include <cmdArduino.h>
#include <DHT.h>
//DHT libraries
DHT dht(A0, DHT11);
void setup()
{
dht.begin();
cmd.begin(57600);
Serial.println("Lab 2b - Command Temp and Humidity");
cmd.add("temp", cmdTemperature);
cmd.add("humid", cmdHumidity);
}
void loop()
{
cmd.poll();
}
void.cmdTemperature(int argc, char**args)
{
float temperature = dht.readTemperature();
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" deg Celsius");
}
void.cmdHumidity(int argc, char**args)
{
float humidity = dht.readHumidity()
Serial.print("Humidity: ");
Serial.print(humidity);
Serial.println(" %RH");
}
3 February 2021 6:44am
Hey,
In the cmdTemperature and cmdHumidity functions, there's full stops between void and cmdTemperature and cmdHumidity. Can you try removing them and see if that works?
Cheers
Jacinta
Jacinta Plucinski