Wire.requestFrom correction on webpage

Posted by Skippy on Thu 27 Aug 2015 08:39 PM — 2 posts, 15,336 views.

#0
Hello,

Thanks for your site! It is very useful.
I was learning about Wire.requestFrom() from your discussion/posts.
On the page
http://gammon.com.au/forum/?id=10896#i2csummary
About in the middle it says
Quote:

Therefore the only reasonable way of doing the Wire.requestFrom is:

But the example after that appears to have the logic reversed. "handle error" would occur if zero was returned, but your condition is not... notted?
Or just swap the comments and its good.
Or maybe I'm totally confused!

Thanks,
Skippy
Australia Forum Administrator #1
You are right, I got that backwards when doing the summary. I changed to compare to zero to make it clearer.

Thanks for letting me know!