I am using ESP32 and SHT21 temp+humidity sensor but while compiling the code I get the following error:
variable "SHT21" is not a type name
I see an SHT21 class defined in the SHT21.cpp file in the library folder. I don't know much about classes so could you please tell what is wrong with the SHT21 class in this case?
Here is the link to the library: https://github.com/markbeee/SHT21
Sketch:
#include <Arduino.h>
#include <Wire.h>
#include "SHT21.h"
SHT21 SHT21;
void setup()
{
SHT21.begin();
Serial.begin(9600);
}
void loop()
{
Serial.print("Humidity(%RH): ");
Serial.print(SHT21.getHumidity());
Serial.print(" Temperature(C): ");
Serial.println(SHT21.getTemperature());
delay(1000);
}