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
#include <Wire.h> | |
#include <LiquidCrystal_I2C.h> | |
#include <ESP8266WiFi.h> | |
#include <ESP8266HTTPClient.h> | |
long pmcf10=0; | |
long pmcf25=0; | |
long pmcf100=0; | |
long pmat10=0; | |
long pmat25=0; |
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
// 接線 GND==>GND VCC==>5V SDA==>A4 SCL==>A5 | |
#include <Wire.h> | |
void setup() | |
{ | |
Wire.begin(); | |
Serial.begin(9600); |
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
// 接線 GND==>GND VCC==>5V SDA==>A4 SCL==>A5 | |
#include <Wire.h> | |
#include <LiquidCrystal_I2C.h> | |
LiquidCrystal_I2C lcd(0x27,20,4); | |
void setup() | |
{ | |
lcd.begin(); |
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
// 1:紫色==>5V (V V)因為V V才是5V的電 2:橘色==>GND 4:藍色RX==>TX 5:綠色TX==>RX | |
#include <Wire.h> | |
#include <ESP8266HTTPClient.h> | |
long pmcf10=0; | |
long pmcf25=0; | |
long pmcf100=0; | |
long pmat10=0; | |
long pmat25=0; | |
long pmat100=0; | |
char buf[50]; |
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
// 1:紫色==>5V (V V)因為V V才是5V的電 2:橘色==>GND 4:藍色RX==>TX 5:綠色TX==>RX | |
// 本程式除了PM2.5 G5外,在多接上一個2*16的LCD當作顯示 | |
// LCD接腳 GND==>GND VCC==>5V SDA==>D2 SCL==>D1 | |
// 利用以上程式可以得到PM1.0、PM2.5、PM10分別在CF=1為標準顆粒物、atmosphere為大氣環境下 | |
// CF=1 根據美國TSI公司的儀器校準 | |
// 大氣環境下 根據中國氣象局的數據校準 | |
#include <LiquidCrystal_I2C.h> //加入LCD函數庫 | |
#include <Wire.h> | |
#include <ESP8266HTTPClient.h> |
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
//ping 11 伺服馬達 控制左右 | |
//ping 10 伺服馬達 控制前後 | |
//ping 9 伺服馬達 控制上下 | |
//ping 5 伺服馬達 控制夾子 | |
//ping A0 第一個搖桿的 URX 控制夾子 | |
//ping A1 第一個搖桿的 URY 控制上下 | |
//ping A2 第二個搖桿的 URX 控制左右 | |
//ping A3 第二個搖桿的 URY 控制前後 | |
//ping A4 接LCD的 SDA | |
//ping A5 接LCD的 SCL |
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
// LCD接線 GND==>GND VCC==>5V SDA==>A4 SDL==>A5 | |
// 多個DS18B20 溫度感測器資料都接在同一個腳位 (數位腳 D6) | |
//需要安裝程式庫 1. LiquidCrystal_I2C.h(LCD用) 2. OneWire.h(DS18B20用) 3. DallasTemperature.h(DS18B20用) | |
#include <Wire.h> | |
#include <LiquidCrystal_I2C.h> | |
LiquidCrystal_I2C lcd(0x27,16,2); | |
#include <OneWire.h> // 引用 OneWire 程式庫 | |
#include <DallasTemperature.h> // 引用 DallasTemperature 程式庫 | |
#define ONE_WIRE_BUS 6 // 定義 DS18B20 資料腳位(數位腳 D6)((所有)溫度感測器都接在同一個腳位) |
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
//搖桿控制車子 | |
//L9110 A-1A=>Pin11 A-1B=>pin10 B-1A=>pin5 B-1B=>pin6 | |
//搖桿 VRX=>A0 VRY=>A1 | |
// LCD接線 GND==>GND VCC==>5V SDA==>A4 SCL==>A5 | |
#include <Wire.h> | |
#include <motoLiquidCrystal_I2C.h> | |
LiquidCrystal_I2C mylcd(0x27,16,2); |
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
//NodeMCU接線 | |
//I2C 1602 LCD顯示器 VCC接到5V;SDA接到D2;SCL接到D1 | |
//DHT11 VCC接到5V;Data接到D4;VCC和Data中間要接一個4.7K的電阻 | |
// | |
#include <Wire.h> | |
#include <LiquidCrystal_I2C.h> | |
#include "DHT.h" | |
LiquidCrystal_I2C lcd(0x27,16,2); |
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
//接線 GND==>GND VCC==>5V SDA==>D2 SDL==>D1 | |
#include <Wire.h> | |
#include <LiquidCrystal_I2C.h> | |
LiquidCrystal_I2C lcd(0x27,16,2); | |
void setup() | |
{ | |
lcd.begin(); |
OlderNewer