SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
By kittyj
#194610
this is part of my arduino code. i want to read the serial on processing arduino. but i cannot input int val[8]; in processing. how can i write it ?

int checkCol(){
int val[8];


for(int i=0; i<num; i++){
digitalWrite(cols,LOW); //anodes o/p and low
pinMode(cols,OUTPUT);

digitalWrite(rows,LOW); //cathodes o/p and low
pinMode(rows,OUTPUT);
}

delayMicroseconds(10);
for(int j=0; j<num; j++){
pinMode(cols[j],INPUT);
}

delayMicroseconds(200);
for ( int col=0; col<num; col++ ){ // read analog values at all anodes
val[col] = analogRead( col );
}

for(int col=0; col<num; col++){ // calculate difference between current values and thresholds
val[col] = val[col] - thresh[col];
}

int signal = 8;
for(int col=0; col<num; col++){
if(val[col] > 25){
signal = col;
break;
}
}


for( int col=0; col<7; col ++ ){
Serial.print(val[col]);
Serial.print(",");
}

Serial.println(val[7]);




return (signal);
}