File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -266,7 +266,7 @@ const
266266void FirmataMarshaller::sendPinStateQuery (uint8_t pin)
267267const
268268{
269- sendSysex (PIN_STATE_QUERY, 1 , &pin);
269+ sendSysex (PIN_STATE_QUERY, sizeof (pin) , &pin);
270270}
271271
272272/* *
@@ -298,3 +298,14 @@ const
298298{
299299 sendSysex (STRING_DATA, strlen (string), (uint8_t *)string);
300300}
301+
302+ /* *
303+ * The sampling interval sets how often analog data and i2c data is reported to the client.
304+ * @param interval_ms The interval (in milliseconds) at which to sample
305+ * @note The default sampling interval is 19ms
306+ */
307+ void FirmataMarshaller::setSamplingInterval (uint16_t interval_ms)
308+ const
309+ {
310+ sendSysex (SAMPLING_INTERVAL, sizeof (interval_ms), &interval_ms);
311+ }
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ class FirmataMarshaller
5252 void sendPinStateQuery (uint8_t pin) const ;
5353 void sendString (const char *string) const ;
5454 void sendSysex (uint8_t command, size_t bytec, uint8_t *bytev) const ;
55+ void setSamplingInterval (uint16_t interval_ms) const ;
5556
5657 private:
5758 /* utility methods */
You can’t perform that action at this time.
0 commit comments