no description
Fork of Middleware by
Diff: SensorPIR.cpp
- Revision:
- 1:32a08ca33b00
- Parent:
- 0:d1ff330c5128
--- a/SensorPIR.cpp Sat Dec 05 17:43:29 2015 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ -/* - -Drivers.cpp - -Only to improve the clarity of main .cpp -This don't have any new classes - -All the multiple task are here -for Smart Room project asked by -Gustavo Torres - -Last update by RoHe 16/11/2015 - -*/ - -#include "SensorPIR.h" - -Drivers::Drivers() -{ - varInt=5; -} - -bool Drivers::is_good(void) -{ - return true; -} - -int Drivers::getVar(void) -{ - return varInt; -} - -char* Drivers::echo(void) -{ - return "Hello from Library"; -} - -/*Defines*/ -//Serial UARTPIR(USBTX, USBRX); -//DigitalOut dout(LED1); -//DigitalIn enable2(D1); -//DigitalIn enable3(D2); -//DigitalIn enable4(D3); - -/*Functions*/ -int GetPersonStatus(int RoomPrescence) { - bool print = 0; - bool RoomStatus = 0; - wait(2); //Wait for sensor to take snap shot of still room - - switch(RoomPrescence) - { - case 1: - if(enable1==1 /*|| enable2==1 || enable3==1 || enable4==1*/) - { - RoomStatus = 1; - ledGREEN=1; - if(print == 0) - { - pc.printf("Presencia detectada\n\r"); - print = 1; - } - } - else - { - RoomStatus = 0; - ledGREEN=0; - if(print == 1) - { - pc.printf("Ninguna presencia detectada\n\r"); - print = 0; - } - } - break; - - case 2: - /*ADD NEW ROOM*/ - break; - - default: - /*Do Nothing*/ - break; - } - return RoomStatus; -} \ No newline at end of file