From 41206c8c3300b01dadebfc31e3adf3dc29214788 Mon Sep 17 00:00:00 2001 From: Hannes Siebeneicher Date: Thu, 14 Sep 2023 16:59:37 +0200 Subject: [PATCH] fix doWhile example --- Language/Structure/Control Structure/doWhile.adoc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Language/Structure/Control Structure/doWhile.adoc b/Language/Structure/Control Structure/doWhile.adoc index 2d81351..01e0972 100644 --- a/Language/Structure/Control Structure/doWhile.adoc +++ b/Language/Structure/Control Structure/doWhile.adoc @@ -41,11 +41,14 @@ A `condição` é uma expressão booleana que é avaliada como verdadeiro ou fal [source,arduino] ---- +// Inicialize x e i com um valor de 0 int x = 0; +int i = 0; do { delay(50); // espera os sensores estabilizarem x = readSensors(); // checa os sensores -} while (x < 100); + i++; // soma 1 a i +} while (i < 100); // repita 100 vezes ----