Merhaba Arkadaslar ; Öncelikle cevaplariniz icin simdiden tesekkür ederim..Benim su an üzerinde calistigim bir proje ile ilgili sorum olacak.. 8*8 piezoresistive matrixim var (basinca karsi cikisa degisik degelerde gerilim veriyor)…basit bir sayici programiyla matrix in satir ve sütünlarini farkli hizlara ayarladim,böylece sensörü otomatik olarak tarayabiliyorum..her taramada sensörüm 64 degisik deger veriyor bu 64 degeri array de kaydetmem ve sonrasinda sonsuz döngü olmamasi icin 10 tarama yapsin ve cikisa bu 10 taramanin ortalamasini versin istiyorum..Arduino da yeniyim kendim birseyler yazdim.. const int numReadings = 64; // Number of readings for each scan const int numLoop=10; //Number of loops for each scan float readings[numReadings]; // the readings from the analog input after each scan float totReadings[numLoop]; //total readings from the analog input scan int index_readings = 0; // the index of the current reading int index_loop=0; // the index of the current loop float average[numReadings]; //Averaged value int total[numReadings][numLoop]; int inputPin = A0; //Determine the pin void setup() { Serial.begin(9600); // initialize all the readings for (int i = 0; i < numReadings; i++) readings[i] = 0; // initialize all the loops for(int j=0; j= numReadings)
// …wrap around to the beginning:
index_readings = 0;
if (index_loop >= numLoop)
// …wrap around to the beginning:
index_loop = 0;
//Take the average value
average[numReadings]=totReadings[numLoop]/numLoop; //Averaged value divided by 10(number of loops)
Serial.println(average[numReadings]); //Print the averaged value 64x1
delay(100);
}
}
}
Kod hata vermiyor ama denemedim…saygilarimla..