servo exercise

Good morning, i’m at school right now and i’m bored as hell so i’ve been writing a little program to control a servo. It’s very simple but i’m a newbie at this so I wanted someone who knows about arduino to take a look at it before I arrive home and try it out. so here’s the code:

#include <servo.h>
Int buttonPin = 3;
Servo rudder;

Void Setup ()
PinMode (buttonPin, INPUT);
rudder.attach (9);
rudder.write (90);

Void loop ()
if (digital Read (buttonPin) == HIGH)
      rudder.write (180) //turns the servo when the button is pressed
      rudder.write (90) //return servo to starting position

thank you very much :grin:

Void is spelledvoid

Int is spelled int

PinMode is spelled pinMode

digital Read is spelled digitalRead

rudder.write (180) Needs more semicolon.

The compiler would have found all those for you.

(I’ve got an Android device too)

So it would be like this?

rudder.write (180);


rudder.write (90);

Thank you very much! (Yes, damn you android...)