Yun, Node, Firmata and PulseIn


hi,

im tryingo implement simple example yun, node , proximity sensor hc-sr04 reported here https://github.com/rwaldron/johnny-five/wiki/ping .
so far im not able working, becasue guess standard firmata shipped arduino ide not implement pulse_in function.
i tried go replacement, f.i. https://gist.github.com/sejoker/c03a395f3e444f147090 or https://github.com/rwaldron/johnny-five/wiki/ping, still no success.

i checked simple sketch (https://gist.githubusercontent.com/flakas/3294829/raw/4bdca307fd4bdb35f95c6b682c318ca61c04e250/hc-sr04.ino)  hardware , works fine.

i guess there still not working firmata firmware.
any suggestion?


thank in advance.
marco

ok. fixed.

the problem firmata firmware.
i added small delay follows

pinmode(argv[0],input);
delaymicroseconds(1);
duration = pulsein(argv[0], argv[1],timeout);

and works properly.
m@rco


Arduino Forum > Products > Arduino Yún (Moderator: fabioc84) > Yun, Node, Firmata and PulseIn


arduino

Comments