WHEN I CALL MY FUNCTION MY COUNTER STOP WORKING

file:///Users/jorgequintero/Desktop/Captura%20de%20pantalla%202016-01-10%20a%20las%202.04.48%20p.m…png

file:///Users/jorgequintero/Desktop/Captura%20de%20pantalla%202016-01-10%20a%20las%202.05.05%20p.m…png

Hello everyone, I have been trying to get a counter and I have got this, the problem appears when I call a function, it stop working, I have tried many ways to get the counter working but it just dont :s

First picture is my counter working, on the second one it’s when I have called my function (named pelotas)

This is my code, kind of long(?) :s

int col={2,9};
int col2={3,4,5,6,7,8};
int fila={10,11,12,13,14,15,16,17};
int s=0;

void setup() // Prog_37_1
{

for (int i=0;i<=1;i++)
{
pinMode(col*,OUTPUT); *
_ digitalWrite(col*,HIGH);_
_
}_
_
for (int i=0;i<=5;i++)_
_
{_
_ pinMode(col2,OUTPUT);
digitalWrite(col2,HIGH);
}
for(int t=0;t<=7;t++)
{
pinMode(fila[t],OUTPUT);
digitalWrite(fila[t],LOW);
}*_

* pinMode(19,INPUT);*
* pinMode(18,INPUT);*
* Serial.begin(9600);*
* }*

* void loop ()*
* {*
* plataformas();*
* s=s+1;*
* Serial.println(s);*
* pelota(s); ->>>> The problem appears here, when I called this function*

* }*

void plataformas()
{

* int matriz[2][8]; //Creamos la matriz para las dos plataformas*

* for (int t=0;t<8;t++)*
* {*
* matriz[0][t]=0; //Siempre hay que llenarlas con 0, eso significara que ese punto esta apagado*
* matriz[1][t]=0; //Llenando con 0*
* }*

* int l= (analogRead(19))/147; //Tomamos la medida del potenciometro, esto nos indicara donde se desea poner la plataforma*
* int y= (analogRead(18))/147; //Tomamos la medida del potenciometro, esto nos indicara donde se desea poner la plataforma*

* matriz[0][y]=1; //Asignamos 1 a estos puntos, 1 significara prendido*
* matriz[0][y+1]=1; //Asignamos 1 a estos puntos, 1 significara prendido*
* matriz[1][l]=1; //Asignamos 1 a estos puntos, 1 significara prendido*
* matriz[1][l+1]=1; //Asignamos 1 a estos puntos, 1 significara prendido*

for (int x=0;x<2;x++) //Debido a que no se pueden prender de la forma en que se quieren los leds, lo que se hace es prenderlos y apagarlos de a uno por uno, tan rapido, que parece que todos estuvieran prendidos al tiempo
{
* for (int y=0;y<8;y++)*
* {*

* if(matriz[x][y]==1) //Se recorre la matriz en busca de 1, es decir leds prendidos*
* { *
* digitalWrite(col[x],LOW); //Se prende el catodo*
* digitalWrite(fila[y],HIGH); //Se prende el anodo*
* delay(1);*
* digitalWrite(col[x],HIGH); //Se apaga el catodo*
* digitalWrite(fila[y],LOW); //Se apaga el anodo*
* } *
* }*
}
}

*void pelota (int a) *
{

* int matriz1[5][8];*
* for (int m=0;m<6;m++)*
* {*
* for (int b=0;b<8;b++)*
* {*
_ matriz1[m]=0; //Llenando con 0_
__ matriz1[m]=0; //Llenando con 0__

** }**
** } **

** matriz1[a][3]=1;**

** for (int x=0;x<6;x++) //Debido a que no se pueden prender de la forma en que se quieren los leds, lo que se hace es prenderlos y apagarlos de a uno por uno, tan rapido, que parece que todos estuvieran prendidos al tiempo**
{
** for (int y=0;y<8;y++)**
** {**

** if(matriz1[x][y]==1) //Se recorre la matriz en busca de 1, es decir leds prendidos**
** { **
** digitalWrite(col2[x],LOW); //Se prende el catodo**
** digitalWrite(fila[y],HIGH); //Se prende el anodo**
** delay(1);**
** digitalWrite(col2[x],HIGH); //Se apaga el catodo**
** digitalWrite(fila[y],LOW); //Se apaga el anodo**
** } **
** }**

}
}

Welcome back to the Forum. You recently posted the same code in a different thread, and you were already asked to use code tags. The code tags make the code look

like this

when posting source code files. It makes it easier to read, and can be copied with a single mouse click. Also, if you don’t do it, some of the character sequences in the code can be misinterpred by the forum code as italics or funny emoticons.
If you have already posted without using code tags, open your message and select “modify” from the pull down menu labelled, “More”, at the lower left corner of the message. Highlight your code by selecting it (it turns blue), and then click on the “</>” icon at the upper left hand corner. Click on the “Save” button. Code tags can also be inserted manually in the forum text using the code and /code metatags.

Please read these two posts:

How to use this forum - please read.
and
Read this before posting a programming question …

Also, it is considered “shouting” to use all capital letters.

Equally badly posted cross-post

Thread locked