Skip to content

12 Бабинцев Сергей - #15

Open
t1343 wants to merge 7 commits into
airlab-course:masterfrom
t1343:master
Open

12 Бабинцев Сергей#15
t1343 wants to merge 7 commits into
airlab-course:masterfrom
t1343:master

Conversation

@t1343

@t1343 t1343 commented Oct 10, 2020

Copy link
Copy Markdown

No description provided.

@vasiliy-uchanev

Copy link
Copy Markdown

А почему названия методов на испанском (это же испанский?)?

@vasiliy-uchanev

Copy link
Copy Markdown

Это выглядит как довольно плохая копипаста с этого сниппета: https://www.facebook.com/permalink.php?story_fbid=2539847012796662&id=924365021011544

Бабинцев 12

@vasiliy-uchanev vasiliy-uchanev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Буду ждать ваших исправлений

Comment thread 1lab/1lab.ino
Comment on lines +4 to +8
int q = 6;
int d = 1;
int t1 = 300;
int t2 = 100;
int t3 = 10;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

названия переменных не передают их смысл

Comment thread 1lab/1lab.ino
int t2 = 100;
int t3 = 10;
int ledPins[] = {2,3,4,5,6,7};
int ledControle = 6;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Всё ещё испанский? 🙃

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

К тому же этот пин вы не используете

Comment thread 1lab/1lab.ino
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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

вот этот кусок кода находится вне тела функции.

Comment thread 1lab/1lab.ino
Comment on lines +22 to +32
void loop() {
delay(10);
button();
}
void button() {
if (buttonOn.wasPressed()) {
d++;
if (d>3) {
d=1;
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Всё что ваша программа делает - меняет переменную d. Вы не выполнили задачу

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants