Error: ? Was not declared in this scope

hello world....

so I'm new to arduino and I'm using some examples.

the basics no problem, move onto something more difficult and i get the same error every time. basically.

my code is the sweep example for servo motors.

note i get the same error with ir, motors and the knob example. basically everything other then blink.........

am i missing something?

// Sweep
// by BARRAGAN <http://barraganstudio.com> 
// This example code is in the public domain.


#include <Servo.h> 
 
Servo myservo;  // create servo object to control a servo 
                // a maximum of eight servo objects can be created 
 
int pos = 0;    // variable to store the servo position 
 
void setup() 
{ 
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object 
} 
 
 
void loop() 
{ 
  for(pos = 0; pos < 180; pos += 1)  // goes from 0 degrees to 180 degrees 
  {                                  // in steps of 1 degree 
    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
    delay(15);                       // waits 15ms for the servo to reach the position 
  } 
  for(pos = 180; pos>=1; pos-=1)     // goes from 180 degrees to 0 degrees 
  {                                
    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
    delay(15);                       // waits 15ms for the servo to reach the position 
  } 
}

the errors are

/Users/arcturus/Documents/Arduino/libraries/SoftwareServo/SoftwareServo.cpp: In member function 'uint8_t SoftwareServo::attach(int)':
/Users/arcturus/Documents/Arduino/libraries/SoftwareServo/SoftwareServo.cpp:27: error: 'digitalWrite' was not declared in this scope
/Users/arcturus/Documents/Arduino/libraries/SoftwareServo/SoftwareServo.cpp:28: error: 'OUTPUT' was not declared in this scope
/Users/arcturus/Documents/Arduino/libraries/SoftwareServo/SoftwareServo.cpp:28: error: 'pinMode' was not declared in this scope
/Users/arcturus/Documents/Arduino/libraries/SoftwareServo/SoftwareServo.cpp: In member function 'void SoftwareServo::write(int)':
/Users/arcturus/Documents/Arduino/libraries/SoftwareServo/SoftwareServo.cpp:51: error: 'clockCyclesPerMicrosecond' was not declared in this scope
/Users/arcturus/Documents/Arduino/libraries/SoftwareServo/SoftwareServo.cpp: In static member function 'static void SoftwareServo::refresh()':
/Users/arcturus/Documents/Arduino/libraries/SoftwareServo/SoftwareServo.cpp:73: error: 'millis' was not declared in this scope
/Users/arcturus/Documents/Arduino/libraries/SoftwareServo/SoftwareServo.cpp:106: error: 'digitalWrite' was not declared in this scope
/Users/arcturus/Documents/Arduino/libraries/SoftwareServo/SoftwareServo.cpp:108: error: 'TCNT0' was not declared in this scope
/Users/arcturus/Documents/Arduino/libraries/SoftwareServo/SoftwareServo.cpp:123: error: 'digitalWrite' was not declared in this scope

thank you in advance for your help

It seems unlikely that, in a sketch using Servo, the compiler would be finding issues with SoftwareServo.cpp.

It looks like you have a third-party library called "SoftwareServo" installed. That seems to be interfering with the use of the built-in Servo library. Perhaps you should remove that library and re-start the IDE to clear the conflict.

Using a different library

// Sweep
// by BARRAGAN <http://barraganstudio.com> 
// This example code is in the public domain.


#include <Servo.h> 
 
Servo myservo;  // create servo object to control a servo 
                // a maximum of eight servo objects can be created 
 
int pos = 0;    // variable to store the servo position 
 
void setup() 
{ 
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object 
} 
 
 
void loop() 
{ 
  for(pos = 0; pos < 180; pos += 1)  // goes from 0 degrees to 180 degrees 
  {                                  // in steps of 1 degree 
    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
    delay(15);                       // waits 15ms for the servo to reach the position 
  } 
  for(pos = 180; pos>=1; pos-=1)     // goes from 180 degrees to 0 degrees 
  {                                
    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
    delay(15);                       // waits 15ms for the servo to reach the position 
  } 
}

/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp: In function 'void handle_interrupts(timer16_Sequence_t, volatile uint16_t*, volatile uint16_t*)':
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp:81: error: 'LOW' was not declared in this scope
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp:81: error: 'digitalWrite' was not declared in this scope
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp:88: error: 'HIGH' was not declared in this scope
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp:88: error: 'digitalWrite' was not declared in this scope
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp:92: error: 'clockCyclesPerMicrosecond' was not declared in this scope
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp: At global scope:
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp:232: error: 'boolean' does not name a type
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp: In constructor 'Servo::Servo()':
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp:249: error: 'clockCyclesPerMicrosecond' was not declared in this scope
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp: In member function 'uint8_t Servo::attach(int, int, int)':
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp:263: error: 'OUTPUT' was not declared in this scope
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp:263: error: 'pinMode' was not declared in this scope
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp:270: error: 'isTimerActive' was not declared in this scope
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp: In member function 'void Servo::detach()':
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp:281: error: 'isTimerActive' was not declared in this scope
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp: In member function 'void Servo::write(int)':
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp:292: error: 'map' was not declared in this scope
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp: In member function 'void Servo::writeMicroseconds(int)':
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp:300: error: 'byte' was not declared in this scope
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp:300: error: expected `;' before 'channel'
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp:301: error: 'channel' was not declared in this scope
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp:309: error: 'clockCyclesPerMicrosecond' was not declared in this scope
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp: In member function 'int Servo::read()':
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp:320: error: 'map' was not declared in this scope
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp: In member function 'int Servo::readMicroseconds()':
/Users/arcturus/Documents/Arduino/libraries/Servo/Servo.cpp:327: error: 'clockCyclesPerMicrosecond' was not declared in this scope

What OS? What version of the IDE? Which board?

mac osx 10.9.3
arduino ide 1.0.5
arduino uno with sensor shield v5 and a tower pro micro servo 9g

I think you should uninstall and reinstall the IDE. You've hosed something. Not necessarily intentionally, but it has happened.

i do like to mess with with stuff. by stuff i mean everything.

somehow i lost a boot loader on another board.......

i like to drink...........

morale of the story is it works perfectly on an outdated laptop so I'm just not gonna use this computer for arduino, i hear it can be done......