Skip to content

Commit 659c292

Browse files
committed
Standardize formatting of example code
- Use the standard "Arduino sketch style" formatting. - Move the print to setup(), so it only happens once.
1 parent 309efcc commit 659c292

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

Language/Functions/Bits and Bytes/bitClear.adoc

+10-7
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,18 @@ Prints the output of `bitClear(x,n)` on two given integers. The binary represent
5252

5353
[source,arduino]
5454
----
55-
void setup()
56-
{
57-
Serial.begin(9600);
55+
void setup() {
56+
Serial.begin(9600);
57+
while (!Serial) {
58+
; // wait for serial port to connect. Needed for native USB port only
59+
}
60+
61+
int x = 6;
62+
int n = 1;
63+
Serial.print(bitClear(x, n)); // print the output of bitClear(x,n)
5864
}
5965
60-
void loop()
61-
{
62-
int x = 6; int n = 1; //setting the value of x and n
63-
Serial.print(bitClear(x,n)); //printing the output of the bitClear(x,n)
66+
void loop() {
6467
}
6568
----
6669
[%hardbreaks]

0 commit comments

Comments
 (0)