![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Proyect for Digital Electronics II
Revision 4:1454e3abad62, committed 2019-07-11
- Comitter:
- junmorenodi
- Date:
- Thu Jul 11 13:42:21 2019 +0000
- Parent:
- 3:d9eded996b51
- Commit message:
- Con Libreria PIR;
Changed in this revision
Main/main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Main/main.cpp Thu Jul 11 13:13:14 2019 +0000 +++ b/Main/main.cpp Thu Jul 11 13:42:21 2019 +0000 @@ -1,11 +1,13 @@ #include "mbed.h" #include "BH1750.h" - +#include "PIR.h" //BH1750 lightSensor(I2C_SDA, I2C_SCL); BH1750 lightSensor(PB_9, PB_8); Serial pc(SERIAL_TX, SERIAL_RX); -PwmOut led(PA_3); +PwmOut led(LED3); +PIR pir_obj(A0); +DigitalOut led_PIR(LED2); int main() { @@ -20,6 +22,9 @@ while(1) { + + led_PIR=pir_obj.getData(); + float Actual_Level=lightSensor.readIntesity(); //Sample Time 120ms Res 1 lx if (Actual_Level<=Desired_Level_1) {