kurbatov / firmata4j

Firmata client written in Java.
MIT License
87 stars 45 forks source link

Missing documentation for pin reporting #29

Closed jpink closed 5 years ago

jpink commented 5 years ago

Hi,

how can I set sampling interval or disable analog / digital pin value reporting? I see them in org.firmata4j.firmata.FirmataMessageFactory, but I don't know how to call it.

And why sampling interval must be less than 100 ms? Why not 5 min or longer? When i open (serial) connection I think there is too much unnecessary traffic.

kurbatov commented 5 years ago

Hi @jpink,

You can set sampling interval the followng way:

device.sendMessage(FirmataMessageFactory.setSamplingInterval(12));

For the reasons behind the threshold values, please, refer to the protocol description. I believe you can customize the implementation of a firmware so that it supports desirable sampling interval.

jpink commented 5 years ago

That method seems to be package protected in latest release 2.3.6. I have use latest cloned one.

kurbatov commented 5 years ago

Hi @jpink,

sendMessage method is part of public API in firmata4j-2.3.7