AP mode
Dependencies: NetworkSocketAPI WizFi310Interface mbed
Fork of WizFi310_TCP_Echo_Server_Example by
Diff: DetectHumanClass/DetectHumanClass.h
- Revision:
- 2:8d119e9b8f5a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DetectHumanClass/DetectHumanClass.h Mon Oct 02 20:48:08 2017 +0000 @@ -0,0 +1,54 @@ +#ifndef DETECTHUMANCLASS_H +#define DETECTHUMANCLASS_H + +#include "mbed.h" +#include "VL53L0X.h" + + +class DetectHumanClass +{ +public: + enum SensorState { + POWER_ON = 0, + SETTING_COMPLETE = 1, + TOF_CALIBRATION_FIN = 2, + PIR_DETECTED = 3, + TOF_DETECTED = 4 + }; + + enum Threshold { + MIN_TOF_THRESHOLD = 0, + MAX_TOF_THRESHOLD = 2000 + }; + + DetectHumanClass(PinName pir_a_port, + PinName pir_b_port, + I2C*, + Timer*, + PinName tx, + PinName rx);//constructor + + + bool SettingSensor();//declare in/out port + bool CalibrateSensor();//calibration TOF sensor + bool DetectPIRState();//Detecting pir sensor + int get_detect_state_();//for using main logic + int init();//for using main logic + bool DetectTOFState();//if detectPIRstate return true, activating TOF sensor + + int detect_sensor_state_ ;//detect_stata variables mattching the SensorState enum + uint16_t calibrationed_distance; + + + + +private: + DigitalIn pir_a_pin_; + DigitalIn pir_b_pin_; + Serial pc; + VL53L0X tof_; + I2C* i2c; + Timer* timer; +}; + +#endif \ No newline at end of file