pin interfacing
parent
78485aa871
commit
b3c11eaec7
@ -1,6 +1,29 @@
|
|||||||
# PIR Sensor
|
# PIR Sensor (Interface to ESP8266)
|
||||||
|
|
||||||
* Schematic
|
* Schematic
|
||||||
+ 
|
+ 
|
||||||
* [Datasheet](./BISS0001-SilvanChip.pdf)
|
* [Datasheet](./BISS0001-SilvanChip.pdf)
|
||||||
* [ESP8266](./esp8266.md)
|
* [ESP8266](./esp8266.md)
|
||||||
|
+ GPIO12 : PIR Out
|
||||||
|
+ VCC : 3.3 / 5V
|
||||||
|
+ GND : GND
|
||||||
|
|
||||||
|
* Sample Arduino Code
|
||||||
|
```arduino
|
||||||
|
int inPin = 12;
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
// put your setup code here, to run once:
|
||||||
|
Serial.begin(9600);
|
||||||
|
|
||||||
|
pinMode(inPin, INPUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
void loop() {
|
||||||
|
// put your main code here, to run repeatedly:
|
||||||
|
int val = digitalRead(inPin);
|
||||||
|
Serial.print("*Detected = "); Serial.println(val);
|
||||||
|
|
||||||
|
Sleep(500);
|
||||||
|
}
|
||||||
|
```
|
||||||
Loading…
Reference in New Issue