You need to issue the API ScanSensor() in your for-loop and check for IsBusy() until not busy any more. Have a look into the PSoC4 Proximity example.
The name of the sensor is "CapSense_1_SENSOR_PROXIMITYSENSOR0_0__PROX", use names only from CapSense_1,h
Afaik we asked you to write down what you expect to happen when the first sms is sent.
Bob
Actually my requirement is to send message if person is detected. But it is sending message after every 5sec delay. What Should I do so thst I will get messsge after human detected.
Please help me bob.
You need, basically, a state machine with 3 different states:
the transitions are with the following conditions:
when state 2 is reached you send out a message. So this state is temporarily and might be skipped at all (then the transition is just between 'no-one detected' and 'someone detected', and the message is send when going to 'detected').
You should think over, how many sms you are going to send within which time. Assume that the detected person leaves the area, comes back, leaves... which would result in sending several smsses (what is the plural of "sms"?) . I would build in a 5 minute time of not sending another sms which can be realized easily with a timer component, an interrupt that counts the timer events and a flag that is reset and set in the appropiate places.
Bob