cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

Anonymous
Not applicable
        Hi all, My project is to s   
0 Likes
Reply
4 Replies
Esteemed Contributor II

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

0 Likes
Reply
Anonymous
Not applicable

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.

0 Likes
Reply
Honored Contributor II

You need, basically, a state machine with 3 different states:

   
        
  1. no person detected
  2.     
  3. person detected, no message sent
  4.     
  5. message sent
  6.    
   

the transitions are with the following conditions:

   
        
  • 1->1: when no-one is detected
  •     
  • 1->2: when someone is detected
  •     
  • 2->3: when the message has been sent
  •     
  • 3->3: when a person is still detected
  •     
  • 3->1: when no-one is detected anymore
  •    
   

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').

0 Likes
Reply
Esteemed Contributor II

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

0 Likes
Reply