# URGENT HELP! measuring humidity and temperature

I want to measure humidity and temperature, so I came across this link…

I connected everything as mentioned, but the problem I am facing is in the script written it gives me a message saying “DHT11_PIN was not declared in this scope”

I need urgent help…

#It defines DHT11_PIN 0 // ADC0

{
byte i = 0;
byte result=0;
for(i=0; i< 8; i++)
{
while(!(PINC & _BV(DHT11_PIN))); // wait for 50us
delayMicroseconds(30);

if(PINC & _BV(DHT11_PIN))
result |=(1<<(7-i));
while((PINC & _BV(DHT11_PIN))); // wait ‘1’ finish
}
return result;
}

void setup()
{
DDRC |= _BV(DHT11_PIN);
PORTC |= _BV(DHT11_PIN);

Serial.begin(9600);
}

void loop()
{
Byte dht11_dat[5];
byte dht11_in;
byte i;
// start condition
// 1. pull-down i/Or pin from 18ms
PORTC &= _BV(DHT11_PIN);
delay(18);
PORTC |= _BV(DHT11_PIN);
delayMicroseconds(40);

DDRC &= _BV(DHT11_PIN);
delayMicroseconds(40);

dht11_in = PINC & _BV(DHT11_PIN);

if(dht11_in)
{
Serial.println(“dht11 start condition 1 not met”);
return;
}
delayMicroseconds(80);

dht11_in = PINC & _BV(DHT11_PIN);

if(!dht11_in)
{
Serial.println(“dht11 start condition 2 not met”);
return;
}
delayMicroseconds(80);
// now ready for dates reception
for (i=0; i<5; i++)

• DDRC |= _BV(DHT11_PIN);*
• PORTC |= _BV(DHT11_PIN);*
• byte dht11_check_sum = dht11_dat[0]+dht11_dat[1]+dht11_dat[2]+dht11_dat[3];*
• // check check_sum*
• if(dht11_dat[4]!= dht11_check_sum)*
• {*
• Serial.println(“DHT11 checksum error”);*
• }*
• Serial.print("Humidity = ");*
• Serial.print(dht11_dat[0], DEC);*
• Serial.print(".");*
• Serial.print(dht11_dat[1], DEC);*
• Serial.print("% ");*
• Serial.print("Temperature = ");*
• Serial.print(dht11_dat[2], DEC);*
• Serial.print(".");*
• Serial.print(dht11_dat[3], DEC);*
• Serial.println("C ");*
• delay(2000);*
}

I've never seen a #it directive. Ever. (Looks like source passed through Google Translate) Please use CODE TAGS when posting code.

If you really need help I would remove the URGENT HELP! from your title. It neatly blinded me. http://arduino.cc/en/Tutorial/Variables

http://www.ajpdsoft.com/modules.php?traducir=es-en&name=News&file=article&sid=572: For testear the program that have sent to Arduino, will open the window of Serial Monitor of the IDE of Arduino, pressing in the button "Serial Monitor":

It looks to me as if the whole page has been translated - and presumably the code has been mangled in the process. The #define is the only obvious corruption, but given that the page has clearly not been proof read and the published code has never been compiled, I wouldn't trust any of it as far as I could throw it.

Hi, Here's some information on using those sensors: http://arduino-info.wikispaces.com/TemperatureHumidity

And a specific example with working code: http://arduino-info.wikispaces.com/PROJECT-Temp-Humidity-Display

Let us know how you make out...