Why my servo doesn't work?


hello!
i built basic circuit arduino , micro servo when uploaded bare program:
code: [select]
servo myservo; 

void setup()
{
  myservo.attach(9);   
}

void loop()
{
  myservo.write(130);                 
  delay(500);                           
  myservo.write(0);
  delay(500);
}

a heap of compline errors appeared ones:
code: [select]
/users/standa/documents/arduino/libraries/servo/servo.cpp: in member function 'uint8_t servo::attach(int)':
/users/standa/documents/arduino/libraries/servo/servo.cpp:28: error: 'digitalwrite' not declared in scope
/users/standa/documents/arduino/libraries/servo/servo.cpp:29: error: 'output' not declared in scope
/users/standa/documents/arduino/libraries/servo/servo.cpp:29: error: 'pinmode' not declared in scope
/users/standa/documents/arduino/libraries/servo/servo.cpp: in member function 'void servo::write(int)':

so switched softwareservo library, updated line @ beginning of softwareservo.h #include <wprogram.h> #include "arduino.h" (it didn't work me before, use arduino v1.0.5) , uploaded code:
code: [select]
#include <softwareservo.h>

softwareservo myservo;

void setup()
{
  myservo.attach(9);
}

void loop()
{
  myservo.write(90);
  softwareservo::refresh();
}

but nothing happened.
all pins connected correctly , tried 4 servos, different arduino board , output pins various values of myservo.write().

do know please wrong should it?
i wonder why servo library provided arduino not work me , advantage of softwareservo library?
thank much.

quote
but when uploaded bare program:
quote
a heap of compline errors appeared ones:

where
code: [select]
#include <servo.h> ?


Arduino Forum > Using Arduino > Programming Questions > Why my servo doesn't work?


arduino

Comments

Popular posts from this blog

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums

Multithumb configuration params not working? - Joomla! Forum - community, help and support