Here’s a quick test video of my Arduino Nerf sentry gun in action. When my hand gets closer to the PING sensor than my initial value (in this case, very close), the gun stops sweeping and starts firing.
I didn’t have ammo in the first few belt casings, so I avoided getting shot. This won’t be the case when I demo it at Maker Faire this weekend.
In the Maker Shed: