Created
January 10, 2019 02:49
-
-
Save clive520/37551d357099d951072e47dd16719113 to your computer and use it in GitHub Desktop.
DHT11溫溼度感測器_顯示距離於LCD_NodeMCU_ESP8266
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Sketch was generated by motoblockly | |
Website: http://www.motoblockly.com | |
Author: www.motoduino.com | |
Date: Wed Jan 09 2019 19:12:47 GMT+0800 | |
*/ | |
//DHT11 接線方式{GND ==> GND VCC==>5V DATA==>D5(14) } | |
//LCD接線方式{GND ==> GND VCC==>5V SDA==>D2(04) SCL==>D1(05)} | |
#include <Wire.h> | |
#include <esp_LiquidCrystal_I2C.h> | |
#include "esp_DHTesp.h" | |
esp_LiquidCrystal_I2C mylcd(0x27, 16, 2); | |
long temperature; | |
long humidity; | |
DHTesp dht; | |
void setup() | |
{ | |
mylcd.init(); | |
mylcd.backlight(); | |
pinMode(14, INPUT); | |
dht.setup(14); | |
temperature = 0; | |
humidity = 0; | |
} | |
void loop() | |
{ | |
temperature = dht.getTemperature(); | |
humidity = dht.getHumidity(); | |
mylcd.clear(); | |
mylcd.setCursor(0,0); | |
mylcd.print(String("Temperature:") + String(temperature) + String(" C")); | |
mylcd.setCursor(0,1); | |
mylcd.print(String("Humidity:") + String(humidity) + String(" %")); | |
delay(5000); | |
} |
You can find this file in
https://www.motoduino.com/wp-content/themes/storefront/moto_iot_blockly_v23/demos/code/index.html
or downloan with
https://www.motoduino.com/wp-content/themes/storefront/moto_iot_blockly_v23/arduino_library/Moto_library.zip
Augus <notifications@github.com> 於 2019年7月18日 週四 上午11:39寫道:
… sorry i can't find the esp_LiquidCrystal_I2C.h of library ,how i can find
this library
thanks~
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<https://gist.github.com/37551d357099d951072e47dd16719113?email_source=notifications&email_token=AJLKELC6U7JGTIBEWURR4DDP77QXDA5CNFSM4IEWVAUKYY3PNVWWK3TUL52HS4DFVNDWS43UINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAFVPUC#gistcomment-2973505>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJLKELBU57Q4ZFY4QF5G743P77QXDANCNFSM4IEWVAUA>
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sorry i can't find the esp_LiquidCrystal_I2C.h of library ,how i can find this library
thanks~