Skip to content

I2C write a buffer bug ? #661

@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

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy