Skip to content

I2C write a buffer bug ? #661

Closed
Closed
@amirc2013

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 ?

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