Servo Compilation Error

Hi there Arduino Forums,

So I’m having a bit of a problem with my servo library. I was really just messing around with making a servo turn 90 degrees and some LEDs light up when the button was pressed, and it would seem my code is fine, it’s just the library that’s not working so well.

When I try to compile a program using it I get this error:

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.
Arduino: 1.0.6 (Windows NT (unknown)), Board: "Arduino Micro"
C:\Users\USER\Documents\Arduino\libraries\Servo\Servo.cpp: In member function 'uint8_t Servo::attach(int)':
C:\Users\USER\Documents\Arduino\libraries\Servo\Servo.cpp:28: error: 'digitalWrite' was not declared in this scope
C:\Users\USER\Documents\Arduino\libraries\Servo\Servo.cpp:29: error: 'OUTPUT' was not declared in this scope
C:\Users\USER\Documents\Arduino\libraries\Servo\Servo.cpp:29: error: 'pinMode' was not declared in this scope
C:\Users\USER\Documents\Arduino\libraries\Servo\Servo.cpp: In member function 'void Servo::write(int)':
C:\Users\USER\Documents\Arduino\libraries\Servo\Servo.cpp:52: error: 'clockCyclesPerMicrosecond' was not declared in this scope
C:\Users\USER\Documents\Arduino\libraries\Servo\Servo.cpp: In static member function 'static void Servo::refresh()':
C:\Users\USER\Documents\Arduino\libraries\Servo\Servo.cpp:74: error: 'millis' was not declared in this scope
C:\Users\USER\Documents\Arduino\libraries\Servo\Servo.cpp:107: error: 'digitalWrite' was not declared in this scope
C:\Users\USER\Documents\Arduino\libraries\Servo\Servo.cpp:109: error: 'TCNT0' was not declared in this scope
C:\Users\USER\Documents\Arduino\libraries\Servo\Servo.cpp:124: error: 'digitalWrite' was not declared in this scope

And THIS is my code, using the Servo library:

//simple button push program for dual lights

//Additional servo library and servo definition to run servo on button push
#include <Servo.h>
Servo servo;

//define button and led pins
const int ButtonPin = 12;
const int Led1 = 6;
const int Led2 = 7;
int buttonState = 0;

void setup(){
  //initialize all pins to their correct state
  pinMode(ButtonPin, INPUT);
  pinMode(Led1, OUTPUT);
  pinMode(Led2, OUTPUT);
  
  //Attach the servo
  servo.attach(9);
}

void loop(){
  buttonState = digitalRead(ButtonPin);

  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  if (buttonState == HIGH) {     
    // turn LED on:
    digitalWrite(Led2, LOW); 
    digitalWrite(Led1, HIGH);
    
    servo.write(0);
    delay(15);
  } 
  else {
    // turn LED off:
    digitalWrite(Led1, LOW);
    digitalWrite(Led2, HIGH);
    
    servo.write(90);
    delay(15);
  } 
}

Thanks!
(p.s. Sorry if this is a repeat topic or something reeeeally stupid)

I suspect the Arduino IDE has not installed properly.

If it was my problem I would remove the IDE and re-install it.

...R