文件名称:_1602_ds1307_dht11_sr04
介绍说明--下载内容均来自于网络,请自行研究使用
arduino + 1602 +dht11 + sr04 + ds1307-#include <LiquidCrystal.h>
LiquidCrystal lcd(2,3,4,5,6,7)
/*
1602
vss to gnd
vdd to 5v
RS TO PIN2
RW TO GND
E TO PIN3
D4 TO PIN4
D5 TO PIN5
D6 TO PIN6
D7 TO PIN7
A TO 5V
K TO GND
*/
#include "Wire.h"
#define DS1307_ADDRESS 0x68
byte zero = 0x00 //workaround for issue#527
/*
DS1307
SDA TO PIN A4
SCL TO PIN A5
VCC TO 5V
GND TO GND
*/
#include <dht11.h>
dht11 DHT11
#define DHT11PIN 8 //DHT11 PIN 3 连接UNO 3
#define TRIGPIN 9
#define ECHOPIN 10
long ping() {
digitalWrite(TRIGPIN, LOW)
delayMicroseconds(2)
digitalWrite(TRIGPIN, HIGH)
delayMicroseconds(10)
digitalWrite(TRIGPIN, LOW)
return pulseIn(ECHOPIN, HIGH)/58
}
void setup() {
Wire.begin()
Serial.begin(9600)
//setDateTime() //MUST CONFIGURE IN FUNCTION
lcd.begin(16, 2)
//lcd.setCursor(0,1)
//lcd.write("LIGHT: ")
pinMode(TRIGPIN, OUTPUT)
pinMode(ECHOPIN, INPUT)
pinMode(13, OUTPUT)
}
void loop() {
//int sensorValue
LiquidCrystal lcd(2,3,4,5,6,7)
/*
1602
vss to gnd
vdd to 5v
RS TO PIN2
RW TO GND
E TO PIN3
D4 TO PIN4
D5 TO PIN5
D6 TO PIN6
D7 TO PIN7
A TO 5V
K TO GND
*/
#include "Wire.h"
#define DS1307_ADDRESS 0x68
byte zero = 0x00 //workaround for issue#527
/*
DS1307
SDA TO PIN A4
SCL TO PIN A5
VCC TO 5V
GND TO GND
*/
#include <dht11.h>
dht11 DHT11
#define DHT11PIN 8 //DHT11 PIN 3 连接UNO 3
#define TRIGPIN 9
#define ECHOPIN 10
long ping() {
digitalWrite(TRIGPIN, LOW)
delayMicroseconds(2)
digitalWrite(TRIGPIN, HIGH)
delayMicroseconds(10)
digitalWrite(TRIGPIN, LOW)
return pulseIn(ECHOPIN, HIGH)/58
}
void setup() {
Wire.begin()
Serial.begin(9600)
//setDateTime() //MUST CONFIGURE IN FUNCTION
lcd.begin(16, 2)
//lcd.setCursor(0,1)
//lcd.write("LIGHT: ")
pinMode(TRIGPIN, OUTPUT)
pinMode(ECHOPIN, INPUT)
pinMode(13, OUTPUT)
}
void loop() {
//int sensorValue
(系统自动生成,下载前可以参看下载内容)
下载文件列表
_1602_ds1307_dht11_sr04
.......................\_1602_ds1307_dht11_sr04.ino