waggle-sensor / wagman

The Waggle Manager (Wagman), a custom circuit board and control system for Wild Waggle Nodes
1 stars 3 forks source link

Usage of Wire library. #30

Open Koepel opened 6 years ago

Koepel commented 6 years ago

The usage of the Wire library is wrong in many places.

A delay between Wire.beginTransmission() and Wire.write() is not needed, because they only operate on a buffer (a buffer inside the Wire library). A delay between Wire.write() and Wire.endTransmission() is also not needed.

A timeout or a delay or waiting after a Wire.requestFrom() is not needed. There is no such thing as a timeout after a Wire.requestFrom(). That has been made up, and copied a lot.

A Wire.requestFrom() should not be followed by a Wire.endTransmission().

The common mistakes are: Common-mistakes I wrote also an alternative explanation of the functions of the Wire library.

seanshahkarami commented 6 years ago

I'm in the process of updating a large part of the existing device firmware, so I'll review the notes you've linked to. I think I've learned a bit more about the library over time and am interested in what's there.

Thanks a lot for this! 😄