and put it in my ver.1.01 related lib folder..
When compile(Just use there example code -- SerialServo.pde), it shows below :
C:\arduino-1.0.1\libraries\SoftwareServo\SoftwareServo.cpp: In member function 'uint8_t SoftwareServo::attach(int)':
C:\arduino-1.0.1\libraries\SoftwareServo\SoftwareServo.cpp:27: error: 'digitalWrite' was not declared in this scope
C:\arduino-1.0.1\libraries\SoftwareServo\SoftwareServo.cpp:28: error: 'OUTPUT' was not declared in this scope
C:\arduino-1.0.1\libraries\SoftwareServo\SoftwareServo.cpp:28: error: 'pinMode' was not declared in this scope
C:\arduino-1.0.1\libraries\SoftwareServo\SoftwareServo.cpp: In member function 'void SoftwareServo::write(int)':
C:\arduino-1.0.1\libraries\SoftwareServo\SoftwareServo.cpp:51: error: 'clockCyclesPerMicrosecond' was not declared in this scope
C:\arduino-1.0.1\libraries\SoftwareServo\SoftwareServo.cpp: In static member function 'static void SoftwareServo::refresh()':
C:\arduino-1.0.1\libraries\SoftwareServo\SoftwareServo.cpp:73: error: 'millis' was not declared in this scope
C:\arduino-1.0.1\libraries\SoftwareServo\SoftwareServo.cpp:106: error: 'digitalWrite' was not declared in this scope
C:\arduino-1.0.1\libraries\SoftwareServo\SoftwareServo.cpp:108: error: 'TCNT0' was not declared in this scope
C:\arduino-1.0.1\libraries\SoftwareServo\SoftwareServo.cpp:123: error: 'digitalWrite' was not declared in this scope
I have the same problem here. I tried only to compile the "knob" exemple (with the supplied Servo library), and got similar compliation erros, with some slight differences however.
In file included from D:\Fichiers executables\Arduino-1.0.1\hardware\arduino\cores\arduino\SoftwareServo.cpp:1:
D:\Fichiers executables\Arduino-1.0.1\hardware\arduino\cores\arduino/SoftwareServo.h:4:22: warning: WProgram.h: No such file or directory
D:\Fichiers executables\Arduino-1.0.1\hardware\arduino\cores\arduino\SoftwareServo.cpp: In member function 'uint8_t SoftwareServo::attach(int)':
D:\Fichiers executables\Arduino-1.0.1\hardware\arduino\cores\arduino\SoftwareServo.cpp:27: error: 'digitalWrite' was not declared in this scope
D:\Fichiers executables\Arduino-1.0.1\hardware\arduino\cores\arduino\SoftwareServo.cpp:28: error: 'OUTPUT' was not declared in this scope
D:\Fichiers executables\Arduino-1.0.1\hardware\arduino\cores\arduino\SoftwareServo.cpp:28: error: 'pinMode' was not declared in this scope
D:\Fichiers executables\Arduino-1.0.1\hardware\arduino\cores\arduino\SoftwareServo.cpp: In member function 'void SoftwareServo::write(int)':
D:\Fichiers executables\Arduino-1.0.1\hardware\arduino\cores\arduino\SoftwareServo.cpp:51: error: 'clockCyclesPerMicrosecond' was not declared in this scope
D:\Fichiers executables\Arduino-1.0.1\hardware\arduino\cores\arduino\SoftwareServo.cpp: In static member function 'static void SoftwareServo::refresh()':
D:\Fichiers executables\Arduino-1.0.1\hardware\arduino\cores\arduino\SoftwareServo.cpp:73: error: 'millis' was not declared in this scope
D:\Fichiers executables\Arduino-1.0.1\hardware\arduino\cores\arduino\SoftwareServo.cpp:106: error: 'digitalWrite' was not declared in this scope
D:\Fichiers executables\Arduino-1.0.1\hardware\arduino\cores\arduino\SoftwareServo.cpp:108: error: 'TCNT0' was not declared in this scope
D:\Fichiers executables\Arduino-1.0.1\hardware\arduino\cores\arduino\SoftwareServo.cpp:123: error: 'digitalWrite' was not declared in this scope
Adding #include<WProgram.h>
or #include "Arduino.h"
didn't solve my problem.
In file included from D:\Fichiers executables\Arduino-1.0.1\hardware\arduino\cores\arduino\SoftwareServo.cpp:1:
This is what the knob example looks like in my copy of the IDE:
// Controlling a servo position using a potentiometer (variable resistor)
// by Michal Rinott <http://people.interaction-ivrea.it/m.rinott>
#include <Servo.h>
Servo myservo; // create servo object to control a servo
int potpin = 0; // analog pin used to connect the potentiometer
int val; // variable to read the value from the analog pin
void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop()
{
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180)
myservo.write(val); // sets the servo position according to the scaled value
delay(15); // waits for the servo to get there
}
It doesn't use SoftwareServo. Why does yours?
Making the change in reply #1 allows the SoftwareSerial example (SerialServo.pde) to compile cleanly in IDE 1.0.1.
Hab mir einen EggBot gebaut hab aber den gleichen Fehler wie bei Euch. "Fehler beim Kompilieren"
C:\Users\Bogdan\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp: In member function 'uint8_t SoftwareServo::attach(int)':
C:\Users\Bogdan\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:27: error: 'digitalWrite' was not declared in this scope
C:\Users\Bogdan\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:28: error: 'OUTPUT' was not declared in this scope
C:\Users\Bogdan\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:28: error: 'pinMode' was not declared in this scope
C:\Users\Bogdan\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp: In member function 'void SoftwareServo::write(int)':
C:\Users\Bogdan\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:51: error: 'clockCyclesPerMicrosecond' was not declared in this scope
C:\Users\Bogdan\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp: In static member function 'static void SoftwareServo::refresh()':
C:\Users\Bogdan\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:73: error: 'millis' was not declared in this scope
C:\Users\Bogdan\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:106: error: 'digitalWrite' was not declared in this scope
C:\Users\Bogdan\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:108: error: 'TCNT0' was not declared in this scope
C:\Users\Bogdan\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:123: error: 'digitalWrite' was not declared in this scope
Hab den "SoftwareServo.zip" aus : Arduino Playground - Servo runtergeladen.
Hab das # Include <WProgram.h> im SoftwareServo nicht gefunden.
Kann mir jemand helfen.
LG. Bernd.