RWB
September 16, 2020, 4:27am
1
I’m trying to get a library converted to run on an Argon and I’m working through the compile errors.
I get this error which makes sense but I am not sure if I’m understanding what their goal was with this or not.
It looks like the while loop is just waiting until the Wire.read() does not return the byte status 10000000.
To me the
while (!(Wire.read() & B10000000));
Should be
while (!(Wire.read() == B10000000));
But I’m not sure if I’m missing something simple here.
RWB:
B10000000
To create binary literals use 0b
, not B
.
This should be 0b10000000
Otherwise the original logic looks correct.
It's actually waiting until the bit is set, using bitwise AND (&).
RWB
September 16, 2020, 4:59am
3
nrobinson2000:
0b
Man I was pretty far off
Thanks for the quick solution!
Glad I didn't assume I knew the fix and asked
1 Like
ScruffR
September 16, 2020, 12:21pm
4
Fun fact:
The B… notation is something very Arduino specific and when including Arduino.h
you will get it back too.
However, the way it is implemented makes me cringe
3 Likes
system
Closed
March 18, 2021, 12:21am
5
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.