Hey, whats up guys ![]()
I'm using Windows 8, and I'm trying to upload a simple code to my arduino Uno board with a DHT22 sensor, but I get that error always and don't know why?! Although I run the same code on my other Linux machine and I get a data in serial monitor!
And here is the code I use
//Libraries
#include <DHT.h>
#include <Adafruit_Sensor.h>
//Constants
#define DHTPIN 2Â Â // what pin we're connected to
#define DHTTYPE DHT22Â // DHT 22Â (AM2302)
DHT dht(DHTPIN, DHTTYPE); //// Initialize DHT sensor for normal 16mhz Arduino
//Variables
int chk;
float hum;Â //Stores humidity value
float temp; //Stores temperature value
void setup()
{
  Serial.begin(9600);
 dht.begin();
}
void loop()
{
  //Read data and store it to variables hum and temp
  hum = dht.readHumidity();
  temp= dht.readTemperature();
  //Print temp and humidity values to serial monitor
  Serial.print("Humidity: ");
  Serial.print(hum);
  Serial.print(" %, Temp: ");
  Serial.print(temp);
  Serial.println(" Celsius");
  delay(2000); //Delay 2 sec.
}
