Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bitWrite.adoc #885

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Language/Functions/Bits and Bytes/bitWrite.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Writes a bit of a numeric variable.

[float]
=== Returns
Nothing
x: the value of the numeric variable after the bit at position n is written.

--
// OVERVIEW SECTION ENDS
Expand All @@ -59,6 +59,7 @@ void setup() {
Serial.println(x, BIN); // 10000000
bitWrite(x, 0, 1); // write 1 to the least significant bit of x
Serial.println(x, BIN); // 10000001
Serial.println(bitWrite(x, 1, 1), BIN); // 10000011
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Serial.println(bitWrite(x, 1, 1), BIN); // 10000011

The example is meant to be a demonstration of the basic usage of the function. Even though it is indisputable that the "return" of the macro must be documented correctly, I don't think it needs to be demonstrated since this is not a common use pattern for bitWrite.

}

void loop() {}
Expand Down