создал функцию, почему-то не работает

Dardanelov
Offline
Зарегистрирован: 26.05.2018

ХЕЛП!!!! создал в программе функцию, компилятор её пропустил, а ардуинка её не выполняет!

скетч вот:

int v1 = 2;
int v2 = 8;
int v3 = 5;
int v4 = 6;
int v5 = 7;
int v6 = 4;
int v7 = 9;
int v8 = 3;
int g1 = A1;
int g2 = 10;
int g3 = A2;
int g4 = 11;
int g5 = A5;
int g6 = A3;
int g7 = 12;
int g8 = A4;
boolean mass [8][8]= {
  {1, 1, 1, 0, 0, 1, 1, 1},
  {1, 1, 1, 0, 0, 1, 1, 1},
  {1, 1, 1, 0, 0, 1, 1, 1},
  {0, 0, 0, 1, 1, 0, 0, 0},
  {0, 0, 0, 1, 1, 0, 0, 0},
  {0, 1, 1, 0, 0, 1, 1, 0},
  {0, 1, 1, 0, 0, 1, 1, 0},
  {0, 1, 1, 0, 0, 1, 1, 0}, 
};
void LEDprint () {
 digitalWrite(v1, mass[0][0]);
 digitalWrite(v2, mass[1][0]);
 digitalWrite(v3, mass[2][0]);
 digitalWrite(v4, mass[3][0]);
 digitalWrite(v5, mass[4][0]);
 digitalWrite(v6, mass[5][0]);
 digitalWrite(v7, mass[6][0]);
 digitalWrite(v8, mass[7][0]);
 digitalWrite(g1, LOW);
 digitalWrite(g2, HIGH);
 digitalWrite(g3, HIGH);
 digitalWrite(g4, HIGH);
 digitalWrite(g5, HIGH);
 digitalWrite(g6, HIGH);
 digitalWrite(g7, HIGH);
 digitalWrite(g8, HIGH);
 delayMicroseconds(200);
 digitalWrite(v1, mass[0][1]);
 digitalWrite(v2, mass[1][1]);
 digitalWrite(v3, mass[2][1]);
 digitalWrite(v4, mass[3][1]);
 digitalWrite(v5, mass[4][1]);
 digitalWrite(v6, mass[5][1]);
 digitalWrite(v7, mass[6][1]);
 digitalWrite(v8, mass[7][1]);
 digitalWrite(g1, HIGH);
 digitalWrite(g2, LOW);
 digitalWrite(g3, HIGH);
 digitalWrite(g4, HIGH);
 digitalWrite(g5, HIGH);
 digitalWrite(g6, HIGH);
 digitalWrite(g7, HIGH);
 digitalWrite(g8, HIGH);
 delayMicroseconds(200);
 digitalWrite(v1, mass[0][2]);
 digitalWrite(v2, mass[1][2]);
 digitalWrite(v3, mass[2][2]);
 digitalWrite(v4, mass[3][2]);
 digitalWrite(v5, mass[4][2]);
 digitalWrite(v6, mass[5][2]);
 digitalWrite(v7, mass[6][2]);
 digitalWrite(v8, mass[7][2]);
 digitalWrite(g1, HIGH);
 digitalWrite(g2, HIGH);
 digitalWrite(g3, LOW);
 digitalWrite(g4, HIGH);
 digitalWrite(g5, HIGH);
 digitalWrite(g6, HIGH);
 digitalWrite(g7, HIGH);
 digitalWrite(g8, HIGH);
 delayMicroseconds(200);
 digitalWrite(v1, mass[0][3]);
 digitalWrite(v2, mass[1][3]);
 digitalWrite(v3, mass[2][3]);
 digitalWrite(v4, mass[3][3]);
 digitalWrite(v5, mass[4][3]);
 digitalWrite(v6, mass[5][3]);
 digitalWrite(v7, mass[6][3]);
 digitalWrite(v8, mass[7][3]);
 digitalWrite(g1, HIGH);
 digitalWrite(g2, HIGH);
 digitalWrite(g3, HIGH);
 digitalWrite(g4, LOW);
 digitalWrite(g5, HIGH);
 digitalWrite(g6, HIGH);
 digitalWrite(g7, HIGH);
 digitalWrite(g8, HIGH);
 delayMicroseconds(200);
 digitalWrite(v1, mass[0][4]);
 digitalWrite(v2, mass[1][4]);
 digitalWrite(v3, mass[2][4]);
 digitalWrite(v4, mass[3][4]);
 digitalWrite(v5, mass[4][4]);
 digitalWrite(v6, mass[5][4]);
 digitalWrite(v7, mass[6][4]);
 digitalWrite(v8, mass[7][4]);
 digitalWrite(g1, HIGH);
 digitalWrite(g2, HIGH);
 digitalWrite(g3, HIGH);
 digitalWrite(g4, HIGH);
 digitalWrite(g5, LOW);
 digitalWrite(g6, HIGH);
 digitalWrite(g7, HIGH);
 digitalWrite(g8, HIGH);
 delayMicroseconds(200);
 digitalWrite(v1, mass[0][5]);
 digitalWrite(v2, mass[1][5]);
 digitalWrite(v3, mass[2][5]);
 digitalWrite(v4, mass[3][5]);
 digitalWrite(v5, mass[4][5]);
 digitalWrite(v6, mass[5][5]);
 digitalWrite(v7, mass[6][5]);
 digitalWrite(v8, mass[7][5]);
 digitalWrite(g1, HIGH);
 digitalWrite(g2, HIGH);
 digitalWrite(g3, HIGH);
 digitalWrite(g4, HIGH);
 digitalWrite(g5, HIGH);
 digitalWrite(g6, LOW);
 digitalWrite(g7, HIGH);
 digitalWrite(g8, HIGH);
 delayMicroseconds(200);
 digitalWrite(v1, mass[0][6]);
 digitalWrite(v2, mass[1][6]);
 digitalWrite(v3, mass[2][6]);
 digitalWrite(v4, mass[3][6]);
 digitalWrite(v5, mass[4][6]);
 digitalWrite(v6, mass[5][6]);
 digitalWrite(v7, mass[6][6]);
 digitalWrite(v8, mass[7][6]);
 digitalWrite(g1, HIGH);
 digitalWrite(g2, HIGH);
 digitalWrite(g3, HIGH);
 digitalWrite(g4, HIGH);
 digitalWrite(g5, HIGH);
 digitalWrite(g6, HIGH);
 digitalWrite(g7, LOW);
 digitalWrite(g8, HIGH);
 delayMicroseconds(200);
 digitalWrite(v1, mass[0][7]);
 digitalWrite(v2, mass[1][7]);
 digitalWrite(v3, mass[2][7]);
 digitalWrite(v4, mass[3][7]);
 digitalWrite(v5, mass[4][7]);
 digitalWrite(v6, mass[5][7]);
 digitalWrite(v7, mass[6][7]);
 digitalWrite(v8, mass[7][7]);
 digitalWrite(g1, HIGH);
 digitalWrite(g2, HIGH);
 digitalWrite(g3, HIGH);
 digitalWrite(g4, HIGH);
 digitalWrite(g5, HIGH);
 digitalWrite(g6, HIGH);
 digitalWrite(g7, HIGH);
 digitalWrite(g8, LOW);
 delayMicroseconds(200);
 };
void setup() {
  pinMode(v1, OUTPUT);
  pinMode(v2, OUTPUT);
  pinMode(v3, OUTPUT);
  pinMode(v4, OUTPUT);
  pinMode(v5, OUTPUT);
  pinMode(v6, OUTPUT);
  pinMode(v7, OUTPUT);
  pinMode(v8, OUTPUT);
  pinMode(g1, OUTPUT);
  pinMode(g2, OUTPUT);
  pinMode(g3, OUTPUT);
  pinMode(g4, OUTPUT);
  pinMode(g5, OUTPUT);
  pinMode(g6, OUTPUT);
  pinMode(g7, OUTPUT);
  pinMode(g8, OUTPUT);
}

void loop() {
  void LEDprint();
}
 

 

sadman41
Offline
Зарегистрирован: 19.10.2016

В лупе void перед именем своей функции уберите. 

b707
Offline
Зарегистрирован: 26.05.2017

Dardanelov, о циклах не слыхали никогда?

ЕвгенийП
ЕвгенийП аватар
Offline
Зарегистрирован: 25.05.2015

Так если не вызывать, то и не будет выполняться.

Если чо, то строка №ХЗ - вторая снизу - это не вызов, а объявление.

Datak
Offline
Зарегистрирован: 09.10.2014

delayMicroseconds(200); - это очень мало. Проверьте, действительно ли нужны именно микросекунды.