Error message


hi,
i trying send temperatures serial monitor dht11 sensor. when try compile code error message 'expected primary-expression before '.' token" on line have bolded below in code.


code: [select]
#include <dht.h>
#include <dht_u.h>
int temppin = 7;
void setup() {
  // put setup code here, run once
serial.flush();
pinmode(temppin, output);
serial.begin(9600);
}

void loop() {
  // put main code here, run repeatedly:
serial.print("temperature");
[b]serial.println(dht.temperature);[/b]
delay(5000);
}


i have tried reinstalling library , did not work. thanks

i think have create dht-type object , use reference object's methods (like below).  look @ examples came dht library (file->examples-dht->...).  

code: [select]
dht dht;

dht.tempearture


Arduino Forum > Using Arduino > Programming Questions > Error message


arduino

Comments

Popular posts from this blog

DHT11 Time out error using v0.4.1library

Sketch upload fails with Java error (___REMOVE___/bin/avrdude)!

Arduino Uno + KTY81/210 temperature sensor