Pages: [1]   Go Down
Author Topic: pulsein function infinite loop  (Read 1557 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

pulsein function infinite loop, waiting for a second signal when there is no exit condition, if not it will have been waiting for.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Not sure of your wording and if there is a question there or not. The pulseIn() command can have a optional 3rd argument that defines a time-out period if the desired pulse transition(s) never occur.

http://arduino.cc/en/Reference/PulseIn
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry,My english is poor.

I saw it in the file source code. Timeout signal is valid only for the front, in the last loop is not out of the code.
I have modified code have been found, but it does not seem accurate at the time.

(arduino v21 for windows,source code in file 'hardware/arduino/cores/arduino/wiring_pulse.c')
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This will be fixed in Arduino 0022: https://github.com/arduino/Arduino/commit/4dad13532fbd9fcc14acd157d3fc20e295c38101
Logged

Pages: [1]   Go Up
Jump to: