Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • Slowing it down a bit would be the first thing I'd try, e.g., crank it up to .5sec. If that fixes it you'll know it's a timing issue. You could also speed up the Arduino side by temporarily removing the Serial.println because it could just be the Arduino can't keep up since it's serial-ing while the host is still blasting I2C data. (Only do one change at a time, obviously). Commented May 18, 2021 at 14:27
  • Changing sleep time to 0.5Sec works but I want to send data every 20ms. Is there any way to do this? What causes the problem exactly? Is Arduino reading data slower than expected? Commented May 18, 2021 at 15:02
  • Serial output is relatively slow. Commented May 18, 2021 at 16:14
  • Got it. Thanks. Commented May 18, 2021 at 16:19
  • Are you using an active level translator for the Arduino and the Pi. This I would expect with a passive (resistor) level translator. A simple trick is to transmit with 2 stop bits and receive with 1. This gives you a free bit time for each character. Commented May 20, 2021 at 5:15