Servo problems
It’s the first time i’m using a servo motor and this motor is new

Here’s the code:


Servo servo1;
int i=0;

void setup() {
  // put your setup code here, to run once:

void loop() {
  for(i=0; i<=180; i++){
  for(i=180; i<=0; i--){

I wanted it to go from 0 degrees to 180, then back to 0, and so on.
The servo moves to 180 and then stops. What could be the reason for that?

Look at the second for loop. Do you really want to test that 180 <=0?


oh. you're right, thanks alot. :)

still though, it doesn't work :(

It sounds like you changed the code. Can you post your latest copy?

it doesn’t work

Bummer. But can you be more descriptive? If your expected behavior is still the same, say so.
Then describe the actual behavior.

And maybe include a wiring diagram. Pencil, paper and a camera are good enough if you use proper detail, like pin numbers.
Of particular interest is how you are powering the servo.