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 break.adoc #354

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
10 changes: 5 additions & 5 deletions Language/Structure/Control Structure/break.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ subCategories: [ "Control Structure" ]
[float]
=== Description
[%hardbreaks]
`break` is used to exit from a link:../for[for], link:../while[while] or link:../dowhile[do...while] loop, bypassing the normal loop condition. It is also used to exit from a link:../switchcase[switch case] statement.
`break` è usata per uscire da costrutti link:../for[for], link:../while[while] o link:../dowhile[do...while], scavalcando le ordinarie condizioni imposte dal costrutto. Viene anche utilizzata per uscire dal costrutto link:../switchcase[switch case].
[%hardbreaks]

--
Expand All @@ -31,15 +31,15 @@ subCategories: [ "Control Structure" ]
[#howtouse]
--
[float]
=== Example Code
In the following code, the control exits the `for` loop when the sensor value exceeds the threshold.
=== Codice di esempio
Nel codice che segue, il controllo esce dal ciclo `for` quando il valore del sensore supera la soglia.
[source,arduino]
----
for (x = 0; x < 255; x ++)
{
analogWrite(PWMpin, x);
sens = analogRead(sensorPin);
if (sens > threshold){ // bail out on sensor detect
sensore = analogRead(sensorPin);
if (sensore > soglia){ // bail out on sensor detect
x = 0;
break;
}
Expand Down