Skip to content

Commit

Permalink
while文の中身をcontinueに変更
Browse files Browse the repository at this point in the history
  • Loading branch information
YusukeKato committed Sep 19, 2024
1 parent f0d2db5 commit e9092b1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 18 deletions.
8 changes: 2 additions & 6 deletions Arduino_Exercises/Exercise10/Exercise10.ino
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,13 @@ void loop()
if (digitalRead(SW1_PIN) == LOW) {
flag = 1;
delay(30);
while (digitalRead(SW1_PIN) == LOW) {
// pass
}
while (digitalRead(SW1_PIN) == LOW) continue;
delay(30);
}
if (digitalRead(SW2_PIN) == LOW) {
flag = 0;
delay(30);
while (digitalRead(SW2_PIN) == LOW) {
// pass
}
while (digitalRead(SW2_PIN) == LOW) continue;
delay(30);
}
if (flag == 1) {
Expand Down
8 changes: 2 additions & 6 deletions Arduino_Exercises/Exercise19/Exercise19.ino
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ void loop()
//マーカーを検出?
if (line_signed == 1) {
if (adc_read_value(PB_0, 10) > 80) {
while (adc_read_value(PB_0, 10) > 60) {
// pass
}
while (adc_read_value(PB_0, 10) > 60) continue;
counter++;
if (counter > 1) {
digitalWrite(LED_PIN, LOW);
Expand All @@ -134,9 +132,7 @@ void loop()
}
} else {
if (adc_read_value(PB_0, 10) < 30) {
while (adc_read_value(PB_0, 10) < 45) {
// pass
}
while (adc_read_value(PB_0, 10) < 45) continue;
counter++;
if (counter > 1) {
digitalWrite(LED_PIN, LOW);
Expand Down
4 changes: 1 addition & 3 deletions Arduino_Exercises/Exercise6/Exercise6.ino
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ void loop()
digitalWrite(LED_PIN, HIGH);
count++;
// delay(30);
while (digitalRead(SW1_PIN) == LOW) {
// pass
}
while (digitalRead(SW1_PIN) == LOW) continue;
// delay(30);
} else {
digitalWrite(LED_PIN, LOW);
Expand Down
4 changes: 1 addition & 3 deletions Arduino_Exercises/Exercise7/Exercise7.ino
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ void loop()
count++;
}
delay(30);
while (digitalRead(SW1_PIN) == LOW) {
// pass
}
while (digitalRead(SW1_PIN) == LOW) continue;
delay(30);
} else {
digitalWrite(LED_PIN, LOW);
Expand Down

0 comments on commit e9092b1

Please sign in to comment.