Arduino schéma - arduino.sk

dht22

Programovanie arduina
Obrázok užívateľa
Príspevky: 64
Registrovaný: Str 30. Okt 2013 18:21:18
Bydlisko: ČR

dht22

Poslaťod Diego » Sob 17. Máj 2014 19:20:41

Ahoj, mám problém s čidlem. Zapojil jsem ho podle návodu na http://arduino8.webnode.cz/news/lekce-6 ... a-vlhkost/ ale ukazuje stále mi vlhkost 1% a teplotu 0.

Nevíte kde dělám chybu?

Díky

Príspevky: 6
Registrovaný: Uto 09. Júl 2013 23:38:12

Re: dht22

Poslaťod fri » Uto 03. Jún 2014 9:42:33

Ahoj,
aku kniznicu pouzivas? DHT22 a DHT11 pokial viem potrebuje trosku odlisny pristup.
Ja pouzivam DHT od adafruit, ta dokaze aj automaticky zistit, o ktore cidlo sa jedna.

Príspevky: 26
Registrovaný: Str 02. Máj 2012 8:32:44

Re: dht22

Poslaťod lolo_671 » Uto 03. Jún 2014 20:14:59


Obrázok užívateľa
Príspevky: 64
Registrovaný: Str 30. Okt 2013 18:21:18
Bydlisko: ČR

Re: dht22

Poslaťod Diego » Štv 19. Jún 2014 18:53:31

Ahoj,
zkusil sem knihovnu odsud:

https://github.com/adafruit/DHT-sensor- ... tester.ino

a píše mi chyby:


In file included from sketch_jun19a.ino:4:
C:\Program Files\arduino-1.0.5\libraries\DHT/DHT.h:13: error: stray '\302' in program
C:\Program Files\arduino-1.0.5\libraries\DHT/DHT.h:13: error: stray '\267' in program
C:\Program Files\arduino-1.0.5\libraries\DHT/DHT.h:13: error: stray '\302' in program
C:\Program Files\arduino-1.0.5\libraries\DHT/DHT.h:13: error: stray '\267' in program
In file included from sketch_jun19a.ino:4:
C:\Program Files\arduino-1.0.5\libraries\DHT/DHT.h:322:46: error: exponent has no digits
C:\Program Files\arduino-1.0.5\libraries\DHT/DHT.h:423: error: stray '\342' in program
C:\Program Files\arduino-1.0.5\libraries\DHT/DHT.h:423: error: stray '\200' in program
C:\Program Files\arduino-1.0.5\libraries\DHT/DHT.h:423: error: stray '\246' in program
C:\Program Files\arduino-1.0.5\libraries\DHT/DHT.h:544: error: stray '#' in program
C:\Program Files\arduino-1.0.5\libraries\DHT/DHT.h:544: error: stray '#' in program
C:\Program Files\arduino-1.0.5\libraries\DHT/DHT.h:544: error: stray '#' in program
C:\Program Files\arduino-1.0.5\libraries\DHT/DHT.h:544: error: stray '#' in program
C:\Program Files\arduino-1.0.5\libraries\DHT/DHT.h:544: error: stray '#' in program
C:\Program Files\arduino-1.0.5\libraries\DHT/DHT.h:544: error: stray '#' in program
C:\Program Files\arduino-1.0.5\libraries\DHT/DHT.h:544: error: stray '#' in program
C:\Program Files\arduino-1.0.5\libraries\DHT/DHT.h:6: error: expected unqualified-id before '<' token
C:\Program Files\arduino-1.0.5\libraries\DHT/DHT.h:544: error: expected unqualified-id before '=' token
C:\Program Files\arduino-1.0.5\libraries\DHT/DHT.h:544: error: expected constructor, destructor, or type conversion before '.' token
C:\Program Files\arduino-1.0.5\libraries\DHT/DHT.h:544: error: expected unqualified-id before '<' token
C:\Program Files\arduino-1.0.5\libraries\DHT/DHT.h:544: error: expected constructor, destructor, or type conversion before '.' token
C:\Program Files\arduino-1.0.5\libraries\DHT/DHT.h:544: error: expected unqualified-id before '<' token
C:\Program Files\arduino-1.0.5\libraries\DHT/DHT.h:587: error: expected unqualified-id before numeric constant
In file included from C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:4,
from sketch_jun19a.ino:18:
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:143: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:144: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:175: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:175: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:290: error: 'size_t' was not declared in this scope
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:302: error: 'size_t' does not name a type
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:319: error: 'size_t' was not declared in this scope
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:319: error: 'size_t' was not declared in this scope
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:319: error: initializer expression list treated as compound expression
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:338: error: 'size_t' has not been declared
In file included from C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:5,
from sketch_jun19a.ino:18:
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/string.h:113: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/string.h:114: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/string.h:115: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/string.h:116: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/string.h:117: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/string.h:117: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/string.h:118: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/string.h:119: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/string.h:120: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/string.h:128: error: 'size_t' does not name a type
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/string.h:130: error: 'size_t' does not name a type
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/string.h:131: error: 'size_t' does not name a type
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/string.h:132: error: 'size_t' does not name a type
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/string.h:134: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/string.h:135: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/string.h:136: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/string.h:137: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/string.h:138: error: 'size_t' does not name a type
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/string.h:143: error: 'size_t' does not name a type
In file included from C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:8,
from sketch_jun19a.ino:18:
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/avr/pgmspace.h:744: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/avr/pgmspace.h:745: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/avr/pgmspace.h:746: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/avr/pgmspace.h:747: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/avr/pgmspace.h:747: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/avr/pgmspace.h:748: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/avr/pgmspace.h:756: error: 'size_t' does not name a type
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/avr/pgmspace.h:757: error: 'size_t' does not name a type
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/avr/pgmspace.h:758: error: 'size_t' does not name a type
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/avr/pgmspace.h:759: error: 'size_t' does not name a type
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/avr/pgmspace.h:760: error: 'size_t' does not name a type
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/avr/pgmspace.h:761: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/avr/pgmspace.h:762: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/avr/pgmspace.h:763: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/avr/pgmspace.h:764: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/avr/pgmspace.h:768: error: 'size_t' does not name a type
In file included from C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:24,
from C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Stream.h:26,
from C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/HardwareSerial.h:28,
from C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:193,
from sketch_jun19a.ino:18:
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/stdio.h:685: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/stdio.h:691: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/stdio.h:713: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/stdio.h:719: error: 'size_t' has not been declared
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/stdio.h:762: error: 'size_t' does not name a type
c:/program files/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/stdio.h:840: error: 'size_t' does not name a type
In file included from C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Printable.h:23,
from C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:27,
from C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Stream.h:26,
from C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/HardwareSerial.h:28,
from C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:193,
from sketch_jun19a.ino:18:
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/new.h:10: error: declaration of 'operator new' as non-function
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/new.h:10: error: 'size_t' was not declared in this scope
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/new.h:11: error: declaration of 'operator new []' as non-function
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/new.h:11: error: 'size_t' was not declared in this scope
In file included from C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:27,
from C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Stream.h:26,
from C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/HardwareSerial.h:28,
from C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:193,
from sketch_jun19a.ino:18:
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Printable.h:36: error: 'size_t' does not name a type
In file included from C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Stream.h:26,
from C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/HardwareSerial.h:28,
from C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:193,
from sketch_jun19a.ino:18:
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:38: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:39: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:48: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:49: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:53: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:55: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:56: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:57: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:58: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:59: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:60: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:61: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:62: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:63: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:64: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:65: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:67: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:68: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:69: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:70: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:71: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:72: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:73: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:74: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:75: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:76: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:77: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Print.h:78: error: 'size_t' does not name a type
In file included from C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/HardwareSerial.h:28,
from C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:193,
from sketch_jun19a.ino:18:
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Stream.h:62: error: 'size_t' has not been declared
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Stream.h:67: error: 'size_t' has not been declared
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Stream.h:67: error: 'size_t' has not been declared
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Stream.h:76: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Stream.h:80: error: 'size_t' does not name a type
In file included from C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:193,
from sketch_jun19a.ino:18:
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/HardwareSerial.h:62: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/HardwareSerial.h:63: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/HardwareSerial.h:64: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/HardwareSerial.h:65: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/HardwareSerial.h:66: error: 'size_t' does not name a type
C:\Program Files\arduino-1.0.5\hardware\arduino\cores\arduino/HardwareSerial.h:67: error: no members matching 'Print::write' in 'class Print'
sketch_jun19a:18: error: 'DHT' does not name a type
sketch_jun19a.ino: In function 'void setup()':
sketch_jun19a:22: error: 'dht' was not declared in this scope
sketch_jun19a.ino: In function 'void loop()':
sketch_jun19a:31: error: 'dht' was not declared in this scope




Program mam:

// Example testing sketch for various DHT humidity/temperature sensors
// Written by ladyada, public domain

#include "DHT.h"

#define DHTPIN 2 // what pin we're connected to

// Uncomment whatever type you're using!
//#define DHTTYPE DHT11 // DHT 11
#define DHTTYPE DHT22 // DHT 22 (AM2302)
//#define DHTTYPE DHT21 // DHT 21 (AM2301)

// Connect pin 1 (on the left) of the sensor to +5V
// Connect pin 2 of the sensor to whatever your DHTPIN is
// Connect pin 4 (on the right) of the sensor to GROUND
// Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor

DHT dht(DHTPIN, DHTTYPE);

void setup() {

dht.begin();
}

void loop() {
// Wait a few seconds between measurements.
delay(2000);

// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();



}


Snad se v tom trochu vyznáte :-D

Díky za rady

Obrázok užívateľa
Príspevky: 64
Registrovaný: Str 30. Okt 2013 18:21:18
Bydlisko: ČR

Re: dht22

Poslaťod Diego » Ned 22. Jún 2014 9:24:59

Problém vyřešen. Sehnal jsem si knihovnu co konečně funguje.
Díky za snahu

Späť na Software