文件名称:_1602_ds1307_dht11_sr04
-
所属分类:
- 标签属性:
- 上传时间:2013-03-16
-
文件大小:1.74kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
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/_1602_ds1307_dht11_sr04.ino
_1602_ds1307_dht11_sr04/_1602_ds1307_dht11_sr04.ino
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.