Skip to content

Commit 79be232

Browse files
authored
Merge pull request #925 from Hannes7eicher/Hannes7eicher/do-while-fix
[MKC-1159] Fix do..while example
2 parents 1f64507 + b43dfa9 commit 79be232

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Language/Structure/Control Structure/doWhile.adoc

+5-1
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,15 @@ do {
4949

5050
[source,arduino]
5151
----
52+
// initialize x and i with a value of 0
5253
int x = 0;
54+
int i = 0;
55+
5356
do {
5457
delay(50); // wait for sensors to stabilize
5558
x = readSensors(); // check the sensors
56-
} while (x < 100);
59+
i++; // increase i by 1
60+
} while (i < 100); // repeat 100 times
5761
----
5862

5963

0 commit comments

Comments
 (0)