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

Method doI2CWrite

modules/io/firmata/firmataclient.js:398–413  ·  view source on GitHub ↗
(address, bytes)

Source from the content-addressed store, hash-verified

396 this.write(0xF7); // SYSEX END
397 }
398 doI2CWrite(address, bytes) {
399 if (!(bytes instanceof ArrayBuffer))
400 bytes = bytes.buffer;
401 bytes = new Uint8Array(bytes);
402
403 this.write(0xF0); // SYSEX BEGIN
404 this.write(0x76); // I2C_REQUEST
405
406 this.write(address & 0x7F); // low 7 bits of address
407 this.write(0); // write, stop, 7 bit address
408
409 for (let i = 0; i < bytes.length; i++)
410 this.write14Bits(bytes[i]);
411
412 this.write(0xF7); // SYSEX END
413 }
414 doPocoGetDimensions() {
415 this.write(0xF0); // SYSEX BEGIN
416 this.write(0x01); // POCO_COMMAND (user command)

Callers 1

writeMethod · 0.80

Calls 2

writeMethod · 0.95
write14BitsMethod · 0.95

Tested by

no test coverage detected