val2 = map(val2, -30, 30, 0, 179); // scale it to use it with the servo (value between 0 and 180) myservo.write(val2); // sets the servo position according to the scaled value if (ystate < -15) { play_3(); } } else { //checking for int sensorValue2 = analogRead(A0);//noise sensor Serial.println(sensorValue2); if(sensorValue2>thresholdvalue) { Serial.println("YES"); //digitalWrite(ledNoise,HIGH); play_4(); //lampoff(); lampblink(); servo1_no(); servo1_no(); servo1R(); delay(1000); } else { lampoff();
val2 = map(val2, -30, 30, 0, 179); // scale it to use it with the servo (value between 0 and 180) myservo.write(val2); // sets the servo position according to the scaled value if (ystate < -15) { play_3(); } } else { //checking for int sensorValue2 = analogRead(A0);//noise sensor Serial.println(sensorValue2); if(sensorValue2>thresholdvalue) { Serial.println("YES"); //digitalWrite(ledNoise,HIGH); play_4(); //lampoff(); lampblink(); servo1_no(); servo1_no(); servo1R(); delay(1000); } else { lampoff();
SeeedStudioAssemblyInstructions.docx