Arduino Forum

Forum 2005-2010 (read only) => Software => Bugs & Suggestions => Topic started by: newbee on Oct 20, 2010, 06:14 pm

Title: Error in lang reference: compound bitwise OR  (|=)
Post by: newbee on Oct 20, 2010, 06:14 pm
Hello,

I think there's a mistake in the following text:

"Consequently - to set bits 0 & 1 of a variable, while leaving the
rest of the variable unchanged, use the compound bitwise AND
operator (&=) with the constant B00000011
1 0 1 0 1 0 1 0 variable
0 0 0 0 0 0 1 1 mask
----------------------
1 0 1 0 1 0 1 1        "

should read: "use the compound bitwise OR (|=) operator"

creates confusion...

Title: Re: Error in lang reference: compound bitwise OR  (|=)
Post by: mellis on Oct 21, 2010, 02:18 pm
Thanks, I corrected this and also split the page in two:
http://arduino.cc/en/Reference/BitwiseCompoundOr
http://arduino.cc/en/Reference/BitwiseCompoundAnd