12 Бабинцев Сергей - #15
Open
t1343 wants to merge 7 commits into
Open
Conversation
|
А почему названия методов на испанском (это же испанский?)? |
|
Это выглядит как довольно плохая копипаста с этого сниппета: https://www.facebook.com/permalink.php?story_fbid=2539847012796662&id=924365021011544 |
Бабинцев 12
vasiliy-uchanev
suggested changes
Mar 28, 2021
vasiliy-uchanev
left a comment
There was a problem hiding this comment.
Буду ждать ваших исправлений
Comment on lines
+4
to
+8
| int q = 6; | ||
| int d = 1; | ||
| int t1 = 300; | ||
| int t2 = 100; | ||
| int t3 = 10; |
There was a problem hiding this comment.
названия переменных не передают их смысл
| int t2 = 100; | ||
| int t3 = 10; | ||
| int ledPins[] = {2,3,4,5,6,7}; | ||
| int ledControle = 6; |
There was a problem hiding this comment.
К тому же этот пин вы не используете
Comment on lines
+34
to
+82
| switch (d) { | ||
|
|
||
| case 1: | ||
|
|
||
| for (int i=0; i<q; i++){ | ||
| digitalWrite(ledPins[i],HIGH); | ||
| delay(t3); | ||
| if (buttonOn.wasPressed()) { | ||
| d++; | ||
| break; | ||
| } | ||
| for (int i=0; i<q; i++){ | ||
| digitalWrite(ledPins[i],LOW); | ||
| if (buttonOn.wasPressed()) { | ||
| d++; | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| break; | ||
| case 2: | ||
|
|
||
| for (int i=0; i<q; i++){ | ||
| digitalWrite(ledPins[i],HIGH); | ||
| delay(t1); | ||
| if (buttonOn.wasPressed()) { | ||
| d++; | ||
| break; | ||
| } | ||
| for (int i=0; i<q; i++){ | ||
| digitalWrite(ledPins[i],LOW); | ||
| if (buttonOn.wasPressed()) { | ||
| d++; | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| break; | ||
|
|
||
| case 3: | ||
| for (int i=0; i<q-2; i++){ | ||
| digitalWrite(ledPins[i],HIGH); | ||
| delay(t1); | ||
| if (buttonOn.wasPressed()) { | ||
| d++; | ||
| break; | ||
| } | ||
| } | ||
| break; |
There was a problem hiding this comment.
вот этот кусок кода находится вне тела функции.
Comment on lines
+22
to
+32
| void loop() { | ||
| delay(10); | ||
| button(); | ||
| } | ||
| void button() { | ||
| if (buttonOn.wasPressed()) { | ||
| d++; | ||
| if (d>3) { | ||
| d=1; | ||
| } | ||
| } |
There was a problem hiding this comment.
Всё что ваша программа делает - меняет переменную d. Вы не выполнили задачу
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.