Combining Microphone & Proximity Sensor - Not Working

Hello everyone,

I was hoping someone would help me out with my code. For some reason, the two sections, the microphone, and proximity sensor don't work together. With everything untouched and uncommented, the proximity sensor section only works. I would have to comment out that section for the microphone section to work. Is there any reason why this is happening? Is there a possibility that this can be fixed?

hope3.0.ino (3.72 KB)

Your in_2 variable and TriggerPin variable share the same pin - pin 9. That is not a good thing. What is your schematic? you have to use separate pins.