| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -266,7 +266,7 @@ const | |||
| 266 | 266 | void FirmataMarshaller::sendPinStateQuery(uint8_t pin) | |
| 267 | 267 | const | |
| 268 | 268 | { | |
| 269 | - sendSysex(PIN_STATE_QUERY, 1, &pin); | ||
| 269 | + sendSysex(PIN_STATE_QUERY, sizeof(pin), &pin); | ||
| 270 | 270 | } | |
| 271 | 271 | ||
| 272 | 272 | /** | |
@@ -298,3 +298,14 @@ const | |||
| 298 | 298 | { | |
| 299 | 299 | sendSysex(STRING_DATA, strlen(string), (uint8_t *)string); | |
| 300 | 300 | } | |
| 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 | |||
| 52 | 52 | void sendPinStateQuery(uint8_t pin) const; | |
| 53 | 53 | void sendString(const char *string) const; | |
| 54 | 54 | void sendSysex(uint8_t command, size_t bytec, uint8_t *bytev) const; | |
| 55 | + void setSamplingInterval(uint16_t interval_ms) const; | ||
| 55 | 56 | ||
| 56 | 57 | private: | |
| 57 | 58 | /* utility methods */ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments