Arduino nano doesn't run code

Hello everyone,

So i am kinda new to Arduino. I first did projects with raspberry pi but that started to get annoying because of the size of that board.
So a couple of days ago i ordered a Arduino Nano Rev3. Now when i started working with it with the standard Arduino IDE software i tried making a MicroServo motor(SG90) turn to my liking.

But now the problem(s)
First i ran into the following; My code wasnt getting uploaded: fixed that by selecting the old bootloader.

So the real problem is after i upload the code the code doesn't run. I'm sure i connected everything good. I have tried writing my own code and i also tried using the example of servo>sweep.
It does say that it is "Done uploading" but the code doesn't run.

All suggestions are really appreciated.

Greetings,
Jesse

The first thing to do is prove to yourself that code does indeed run:

  • Disconnect the Servo and anything else from your Nano.
  • File > Examples > 01.Basics > Blink
  • Sketch > Upload

After the upload finishes, does the LED on the Nano blink? If so, the code is running.

Now back to File > Examples > Servo > Sweep. The problem is almost certainly in the hardware. Maybe your servo is not connected to the Nano correctly. Maybe your servo is not powered correctly. We can't see how you have things wired up so we won't be able to help unless you provide the necessary information.

I connected the pins to red>5v ,brown>gnd ,orange> digital pin 9.

The blink sketch does indeed run. But i also tried doing the servo again but it still didnt work it gave the same message of "Done uploading" but the servo didnt move...

Nevermind i got it! thanks for your help

Jesse_p10:
Nevermind i got it! thanks for your help

Others can learn from your mistakes.

Mind sharing the issue and the solution.