From 95783b750fda95f5f4c1fac00ab24da03b31b517 Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Mon, 25 Oct 2010 21:15:28 -0400 Subject: arduino language reference nearing completion, properly CC-BY-SA 3.0 attributed --- docs/source/arduino/dowhile.rst | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) (limited to 'docs/source/arduino/dowhile.rst') diff --git a/docs/source/arduino/dowhile.rst b/docs/source/arduino/dowhile.rst index 48fe75b..697e4b7 100644 --- a/docs/source/arduino/dowhile.rst +++ b/docs/source/arduino/dowhile.rst @@ -1,33 +1,24 @@ -.. _arduino-dowhile: - -do - while -========== +.. highlight:: cpp -The **do** loop works in the same manner as the **while** loop, -with the exception that the condition is tested at the end of the -loop, so the **do** loop will *always* run at least once. +.. _arduino-dowhile: +do/while Loop +============= +A ``do`` loop works in the same manner as a :ref:`while +` loop, with the exception that the condition is tested +at the end of the loop, so the ``do`` loop will *always* run at least +once. -:: +This is the basic syntax:: - do - { + do { // statement block } while (test condition); +Example:: - -Example -------- - -:: - - do - { + do { delay(50); // wait for sensors to stabilize x = readSensors(); // check the sensors - } while (x < 100); - - -- cgit v1.2.3