Need some help for a science project.

Hi-

I can't figure that circuit out from that pic. What's that mishmash of wires on the breadboard?

You need to take a clearer pic- maybe straight down from above?- and also draw a circuit on paper and post that as well.

Here's a test you should do: with the circuit like it is, use the SWEEP sketch. If necessary change the pin number in sweep to match the pin you used for the servo control- looks round about pin 10 or so from that photo?- and compile and upload to Uno.

myservo.attach(9); <<<<<<<<<< make sure this number is correct in sweep

Assuming sweep works, you'll at least know that the servo and the circuit are good. If servo doesn't sweep, and we know the sweep sketch is good, then you can try see what's wrong with the circuit.

Edit.... To make your sketch easier to read, when you post code you should select it all and hit the # button above the :wink: smiley. That formats the code like mine in this post.