91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 0.96M
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-06-06
  • 語(yǔ)言: 其他
  • 標(biāo)簽: 其他??

資源簡(jiǎn)介

libraries.zip

資源截圖

代碼片段和文件信息

//
//????FILE:?dht11.cpp
//?VERSION:?0.4.1
//?PURPOSE:?DHT11?Temperature?&?Humidity?Sensor?library?for?Arduino
//?LICENSE:?GPL?v3?(http://www.gnu.org/licenses/gpl.html)
//
//?DATASHEET:?http://www.micro4you.com/files/sensor/DHT11.pdf
//
//?HISTORY:
//?George?Hadjikyriacou?-?Original?version?(??)
//?Mod?by?SimKard?-?Version?0.2?(24/11/2010)
//?Mod?by?Rob?Tillaart?-?Version?0.3?(28/03/2011)
//?+?added?comments
//?+?removed?all?non?DHT11?specific?code
//?+?added?references
//?Mod?by?Rob?Tillaart?-?Version?0.4?(17/03/2012)
//?+?added?1.0?support
//?Mod?by?Rob?Tillaart?-?Version?0.4.1?(19/05/2012)
//?+?added?error?codes
//

#include?“dht11.h“

//?Return?values:
//?DHTLIB_OK
//?DHTLIB_ERROR_CHECKSUM
//?DHTLIB_ERROR_TIMEOUT
int?dht11::read(int?pin)
{
//?BUFFER?TO?RECEIVE
uint8_t?bits[5];
uint8_t?cnt?=?7;
uint8_t?idx?=?0;

//?EMPTY?BUFFER
for?(int?i=0;?i
//?REQUEST?SAMPLE
pinMode(pin?OUTPUT);
digitalWrite(pin?LOW);
delay(18);
digitalWrite(pin?HIGH);
delayMicroseconds(40);
pinMode(pin?INPUT);

//?ACKNOWLEDGE?or?TIMEOUT
unsigned?int?loopCnt?=?10000;
while(digitalRead(pin)?==?LOW)
if?(loopCnt--?==?0)?return?DHTLIB_ERROR_TIMEOUT;

loopCnt?=?10000;
while(digitalRead(pin)?==?HIGH)
if?(loopCnt--?==?0)?return?DHTLIB_ERROR_TIMEOUT;

//?READ?OUTPUT?-?40?BITS?=>?5?BYTES?or?TIMEOUT
for?(int?i=0;?i<40;?i++)
{
loopCnt?=?10000;
while(digitalRead(pin)?==?LOW)
if?(loopCnt--?==?0)?return?DHTLIB_ERROR_TIMEOUT;

unsigned?long?t?=?micros();

loopCnt?=?10000;
while(digitalRead(pin)?==?HIGH)
if?(loopCnt--?==?0)?return?DHTLIB_ERROR_TIMEOUT;

if?((micros()?-?t)?>?40)?bits[idx]?|=?(1?< if?(cnt?==?0)???//?next?byte?
{
cnt?=?7;????//?restart?at?MSB
idx++;??????//?next?byte!
}
else?cnt--;
}

//?WRITE?TO?RIGHT?VARS
????????//?as?bits[1]?and?bits[3]?are?allways?zero?they?are?omitted?in?formulas.
humidity????=?bits[0];?
temperature?=?bits[2];?

uint8_t?sum?=?bits[0]?+?bits[2];??

if?(bits[4]?!=?sum)?return?DHTLIB_ERROR_CHECKSUM;
return?DHTLIB_OK;
}
//
//?END?OF?FILE
//

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2012-09-05?10:45??Dht11\
?????文件????????2149??2012-09-04?14:09??Dht11\dht11.cpp
?????文件?????????392??2012-09-04?14:38??Dht11\dht11.h
?????目錄???????????0??2012-09-05?10:45??Dht11\examples\
?????目錄???????????0??2012-09-05?10:45??Dht11\examples\dht11\
?????文件????????2474??2012-09-05?10:41??Dht11\examples\dht11\dht11.ino
?????目錄???????????0??2014-07-05?22:10??U8glib\
?????文件????????6225??2014-07-05?22:10??U8glib\ChangeLog
?????文件?????????733??2014-07-05?22:10??U8glib\INSTALL.TXT
?????文件????????2764??2014-07-05?22:10??U8glib\U8glib.cpp
?????文件???????53814??2014-07-05?22:10??U8glib\U8glib.h
?????目錄???????????0??2014-07-05?22:10??U8glib\examples\
?????目錄???????????0??2014-07-05?22:10??U8glib\examples\A2Printer\
?????文件????????3751??2014-07-05?22:10??U8glib\examples\A2Printer\A2Printer.ino
?????目錄???????????0??2014-07-05?22:10??U8glib\examples\Bitmap\
?????文件???????11286??2014-07-05?22:10??U8glib\examples\Bitmap\Bitmap.ino
?????目錄???????????0??2014-07-05?22:10??U8glib\examples\Chess\
?????文件???????12859??2014-07-05?22:10??U8glib\examples\Chess\Chess.ino
?????目錄???????????0??2014-07-05?22:10??U8glib\examples\Color\
?????文件???????12122??2014-07-05?22:10??U8glib\examples\Color\Color.ino
?????目錄???????????0??2014-07-05?22:10??U8glib\examples\Console\
?????文件???????13705??2014-07-05?22:10??U8glib\examples\Console\Console.ino
?????目錄???????????0??2014-07-05?22:10??U8glib\examples\F\
?????文件???????11594??2014-07-05?22:10??U8glib\examples\F\F.ino
?????目錄???????????0??2014-07-05?22:10??U8glib\examples\FPS\
?????文件???????18888??2014-07-05?22:10??U8glib\examples\FPS\FPS.ino
?????目錄???????????0??2014-07-05?22:10??U8glib\examples\GraphicsTest\
?????文件???????14687??2014-07-05?22:10??U8glib\examples\GraphicsTest\GraphicsTest.ino
?????目錄???????????0??2014-07-05?22:10??U8glib\examples\HelloWorld\
?????文件???????11867??2014-07-05?22:10??U8glib\examples\HelloWorld\HelloWorld.ino
?????目錄???????????0??2014-07-05?22:10??U8glib\examples\Menu\
............此處省略127個(gè)文件信息

評(píng)論

共有 條評(píng)論