MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / doI2CRead

Method doI2CRead

modules/io/firmata/firmataclient.js:383–397  ·  view source on GitHub ↗
(address, count)

Source from the content-addressed store, hash-verified

381 this.write(0xF7); // SYSEX END
382 }
383 doI2CRead(address, count) {
384 if (undefined == count) {
385 return;
386 }
387
388 this.write(0xF0); // SYSEX BEGIN
389 this.write(0x76); // I2C_REQUEST
390
391 this.write(address & 0x7F); // low 7 bits of address
392 this.write(0x08); // read once, stop, 7 bit address
393
394 this.write14Bits(count);
395
396 this.write(0xF7); // SYSEX END
397 }
398 doI2CWrite(address, bytes) {
399 if (!(bytes instanceof ArrayBuffer))
400 bytes = bytes.buffer;

Callers 1

readMethod · 0.80

Calls 2

writeMethod · 0.95
write14BitsMethod · 0.95

Tested by

no test coverage detected