Yes its me again. This is the last thread for my project. I saw where the library SoftwareServo would work on tiny chips. So I installed it and grabed some code to test it off the internet and this is what greeted me:
C:\Users\Wrigley5\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp: In member function 'uint8_t SoftwareServo::attach(int)':
C:\Users\Wrigley5\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:27: error: 'digitalWrite' was not declared in this scope
C:\Users\Wrigley5\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:28: error: 'OUTPUT' was not declared in this scope
C:\Users\Wrigley5\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:28: error: 'pinMode' was not declared in this scope
C:\Users\Wrigley5\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp: In member function 'void SoftwareServo::write(int)':
C:\Users\Wrigley5\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:51: error: 'clockCyclesPerMicrosecond' was not declared in this scope
C:\Users\Wrigley5\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp: In static member function 'static void SoftwareServo::refresh()':
C:\Users\Wrigley5\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:73: error: 'millis' was not declared in this scope
C:\Users\Wrigley5\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:106: error: 'digitalWrite' was not declared in this scope
C:\Users\Wrigley5\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:108: error: 'TCNT0' was not declared in this scope
C:\Users\Wrigley5\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:123: error: 'digitalWrite' was not declared in this scope
And this is the code I found:
#include <SoftwareServo.h>
SoftwareServo 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(1); // attaches the servo on pin 1 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
SoftwareServo::refresh();
}
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
SoftwareServo::refresh();
}
}
Maybe its because Im running the newer 1.0.5 Arduino release? Pretty much the same thing happened when I tried using the servo8bit library. Apologies if this has been covered before.