Shop OBEX P1 Docs P2 Docs Learn Events
POLLWAIT Issue — Parallax Forums

POLLWAIT Issue

I am using the POLLWAIT command to wait for a sensor response.
Code is attached below

It works erratically. Sometimes it waits for the sensor response other times it continued as if it received a high state.
I have scope on the pin. Scope shows low and program continues as if it received a high signal.
Please help...

Comments

  • I am using the POLLWAIT command to wait for a sensor response.
    Code is attached below

    It works erratically. Sometimes it waits for the sensor response other times it continued as if it received a high state.
    I have scope on the pin. Scope shows low and program continues as if it received a high signal.
    Please help...

    I would probably be better to include the schematics or a picture of your setup. Your sensor may need a pull down resistor. What is the part number of your sensor?
  • One thought, the POLLIN 8,1 continues to be active. So, if you happen to hold the pushbutton on p8 down longer than 0.5 second, the code will drop right through to the message that the laser has triggered, even though it has not and p9 has stayed low. If that is a concern, POLLMODE 0 in between the segments would cancel the wait on p8.
  • Tracy,
    Thank you for the suggestion.
    I had to put POLLMODE 0 after both POLLWAITs.
    Now it is stable and waits for the Laser Receiver's interrupt signal.

    Thank you again...
Sign In or Register to comment.