I have a program that work with 1 sensor I like to use more sensors how I do this ?
Code I use now are >
int ledPin1 = 13;
int EP = 10;
void setup() {
pinMode(ledPin1, OUTPUT);
pinMode(EP, INPUT); //set EP input for measurment
Serial.begin(9600); //init serial 9600
Serial.println("----------------------Vibration demo------------------------");
}
void loop() {
long measurement = TP_init();
delay(10);
Serial.print("measurment = ");
Serial.println(measurement);
if (measurement > 50) {
delay(100);
digitalWrite(ledPin1, HIGH);
delay(3000);
}
else {
digitalWrite(ledPin1, LOW);
}
}
long TP_init() {
delay(10);
long measurement = pulseIn (EP, HIGH); //wait for the pin to get HIGH and returns measurement
return measurement;
}