My arduino uno is having a problem running a certain sketch. when it gets halfway through, the pin 13 led flashes briefly, and the
sketch restarts itself. I have 2 servos and one ultrasonic sensor attached to the 5v+ pin, the servos to digital 2 and 3, and the ultrasonic to 7.
The crystal ball is out at the cleaners, so it might help to post that "certain sketch". Is the power supply sufficient for the servos?
i am using a nine volt battery
OK, get back to us when you've fixed that.
(deleted)
What @AWOL is saying is that a 9V battery is undoubtedly inadequate to power a servo (let alone two). Likely that the voltage is dropping and causing a reset via the brownout detector.