Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add readbytedata method #89

Closed
wants to merge 1 commit into from

Conversation

matheussampaio
Copy link

Creating interface for i2c_smbus_read_byte_data(file, position).

Example (read EDID data):

const i2c = new I2C(0x50, { device: '/dev/i2c-1' }, async (error) => {
    if (error) {
        return console.error(error);
    }

    i2c.readByteDataAsync = util.promisify(i2c.readByteData);

    const edid = [];

    for (let i = 0; i < 256; i++) {
        const byte = await i2c.readByteDataAsync(i);

        edid.push(byte);
    }

    return console.log(edid);
});

@rzr
Copy link

rzr commented Jan 13, 2020

May I suggest to consider to forward to abandonware fork

Relate-to: #97

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants