Skip to content

I2C write a buffer bug ? #661

Description

@amirc2013

Im trying to send a buffer over a I2C communication.
this is the code i used :

 Wire.beginTransmission(SCREEN_WRITE_addr);
  Wire.write(addr);
  unsigned char* ptr = data;
  for (int i = 0 ; i < len ; i++) {
    Wire.write(*ptr);
     if (DEBUG) {
      Serial.print("WE WROTE :");
      Serial.println(*ptr,HEX);
    }
    ptr++;
  }
  Wire.endTransmission(true);

some how only the last byte has been sent ... why ?

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug 🐛Something isn't working

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions