Let's Make Robots!

My first hand written code.

I have just written my first code in Arduino IDE. The code should make a servo move to 180 degrees wait one second and then move back to 0 degrees and repeat.

Here it is :

 

#include <Servo.h>

 

Servo servo1;

int posR = 179;

int posL = 0;

 

void setup()

{

  servo1.attach(9);

}

 

void loop()

{  

  { 

     servo1.write(posR);

     delay(1000);

  }

  {