Use to WIZwiki-W7500, Sensing to PIR motion sensor module(HC-SR501)
Dependencies: mbed
Fork of PIR_Motion_Sensor_WIZwiki-W7500 by
Prerequisite
This example is for PIR test using digital I/O.
To implement this function, you need a Platform board, network Interface board.
- WIZwiki-W7500 from WIZnet (Platform board and Ethernet I/F board)
Hardware Configuration
WIZwiki-W7500 Pin map
PIR Sensor(HC-501SR) Pin map
Wiring Table
HC-501SR | W7500 |
VCC | 5V |
GND | GND |
SIGNAL | D8 or PC_7 |
Software
Init GPIO
DigitalOut myled(LED1); // Alert LED DigitalIn PIR(PC_7); // PIR Signal //D8
Get data from PIR
int PIR_sensor; // declare variable for PIR input data while(1) { PIR_sensor = PIR; // Check input signal from PIR pin pc.printf("PIR Value : %d\r\n",PIR_sensor); myled =! PIR_sensor; // PIR(HIGH) == LED On // PIR(LOW) == LED Off wait(0.1f); }
Caution
When wiring, be careful (GND, VCC)
mbed.bld@0:9ea50fe6902c, 2015-06-29 (annotated)
- Committer:
- nanjsk
- Date:
- Mon Jun 29 05:52:26 2015 +0000
- Revision:
- 0:9ea50fe6902c
- Child:
- 1:b8bd8695558d
Use to WIZwiki-W7500, Sensing to PIR sensor module(HC-SR501)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nanjsk | 0:9ea50fe6902c | 1 | http://mbed.org/users/mbed_official/code/mbed/builds/7cff1c4259d7 |