AP mode

Dependencies:   NetworkSocketAPI WizFi310Interface mbed

Fork of WizFi310_TCP_Echo_Server_Example by WIZnet

Committer:
maru536
Date:
Mon Oct 02 22:02:47 2017 +0000
Revision:
5:e313e52adcaf
Parent:
3:4b4eb90875bd
LED Complete

Who changed what in which revision?

UserRevisionLine numberNew contents of line
maru536 2:8d119e9b8f5a 1 #include "detect.h"
maru536 2:8d119e9b8f5a 2 #include "info.h"
maru536 2:8d119e9b8f5a 3 #include "tts.h"
maru536 2:8d119e9b8f5a 4 #include "push.h"
maru536 2:8d119e9b8f5a 5
maru536 5:e313e52adcaf 6
maru536 2:8d119e9b8f5a 7 I2C m_i2c(PA_10 , PA_09);
maru536 2:8d119e9b8f5a 8 Timer m_timer;
maru536 2:8d119e9b8f5a 9
maru536 2:8d119e9b8f5a 10 DetectHumanClass detect(PC_15,
maru536 2:8d119e9b8f5a 11 PC_14,
maru536 2:8d119e9b8f5a 12 &m_i2c,
maru536 2:8d119e9b8f5a 13 &m_timer,
maru536 2:8d119e9b8f5a 14 USBTX,
maru536 2:8d119e9b8f5a 15 USBRX);
maru536 2:8d119e9b8f5a 16
maru536 5:e313e52adcaf 17 void detecting(VS1053 *player, TCPSocket *socket, char* buf, char* id, ShiftRegisterControlClass led)
maru536 2:8d119e9b8f5a 18 {
maru536 2:8d119e9b8f5a 19 while(1) {
maru536 2:8d119e9b8f5a 20 while(1) {
maru536 2:8d119e9b8f5a 21 int sensor_state = detect.get_detect_state_();
maru536 2:8d119e9b8f5a 22 if(sensor_state == detect.POWER_ON) {
maru536 2:8d119e9b8f5a 23 detect.SettingSensor();
maru536 2:8d119e9b8f5a 24 } else if(sensor_state == detect.SETTING_COMPLETE) {
maru536 2:8d119e9b8f5a 25 detect.CalibrateSensor();
maru536 2:8d119e9b8f5a 26 } else if(sensor_state == detect.TOF_CALIBRATION_FIN) {
maru536 2:8d119e9b8f5a 27 detect.DetectPIRState();
maru536 2:8d119e9b8f5a 28 } else if(sensor_state == detect.PIR_DETECTED) {
maru536 2:8d119e9b8f5a 29 detect.DetectTOFState();
maru536 2:8d119e9b8f5a 30 } else if(sensor_state == detect.TOF_DETECTED) {
maru536 2:8d119e9b8f5a 31 break;
maru536 2:8d119e9b8f5a 32 }
maru536 2:8d119e9b8f5a 33 }
maru536 2:8d119e9b8f5a 34 detect.init();
maru536 2:8d119e9b8f5a 35 printf("detect!\n");
maru536 2:8d119e9b8f5a 36
maru536 5:e313e52adcaf 37 recvInfo(socket, buf, id, led);
maru536 2:8d119e9b8f5a 38 playTTS(player, socket, buf);
maru536 2:8d119e9b8f5a 39 requestNoti(socket, id, buf);
maru536 2:8d119e9b8f5a 40 }
maru536 2:8d119e9b8f5a 41 }