Understanding SoftwareServo.h library

Does anybody know that this library supports continuous rotation servos? And if so provide a simple sketch on how to use them please and thank you.

Also I’m getting this error with pinMode function:

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 Uno”
sketch_oct20b:25: error: expected constructor, destructor, or type conversion before ‘(’ token
sketch_oct20b:26: error: expected constructor, destructor, or type conversion before ‘(’ token

#include <SoftwareServo.h>

// Defining Servos and Other Items
SoftwareServo HOIST;

int joyLR1 = A0;  // analog pin used to connect the Joystick 1

int val0;    // variable to read the value from the analog pin 

pinMode(7, OUTPUT);
pinMode(A0, INPUT);
  
void setup()
{
  Serial.begin(9600);
  Serial.println("Hello World");
  
  HOIST.attach (7);
  
  val0 = analogRead(A0);             
  val0 = map(val0, 0, 1023, 0, 359);   
  HOIST.write(val0);                   
  delay(15);                           
  SoftwareServo::refresh();
}

void loop()
{
}

The problem is not with the SoftwareServo library. The calls to pinMode() need to be in the setup() function.

Thanks for the pinMode help but now having an issues with the attach function and giving me 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 Uno”
C:\Users\Brandon\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp: In member function ‘uint8_t SoftwareServo::attach(int)’:
C:\Users\Brandon\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:27: error: ‘digitalWrite’ was not declared in this scope
C:\Users\Brandon\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:28: error: ‘OUTPUT’ was not declared in this scope
C:\Users\Brandon\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:28: error: ‘pinMode’ was not declared in this scope
C:\Users\Brandon\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp: In member function ‘void SoftwareServo::write(int)’:
C:\Users\Brandon\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:51: error: ‘clockCyclesPerMicrosecond’ was not declared in this scope
C:\Users\Brandon\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp: In static member function ‘static void SoftwareServo::refresh()’:
C:\Users\Brandon\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:73: error: ‘millis’ was not declared in this scope
C:\Users\Brandon\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:106: error: ‘digitalWrite’ was not declared in this scope
C:\Users\Brandon\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:108: error: ‘TCNT0’ was not declared in this scope
C:\Users\Brandon\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:123: error: ‘digitalWrite’ was not declared in this scope

Any suggestions?

It sounds like the SoftwareServo library predates version 1.0 of the iDE.
In SoftwareServo.h, This:

#include <WProgram.h>

Needs replacing with:

#include "Arduino.h"

Is there some reason why you want to use SoftwareServo, rather than the supplied, timer based, Servo library?

I want to use ADAFRUIT WaveHC and the Servo libraries, but there is an interrupt conflict between the two libraries is the reason why I'm using the SoftwareServo library instead now, but need to make sure that this new library will work with CR servos. And thank you UKhelibob.

There is a ServoTimer2 library which works like the standard library except that it only works with microseconds (and not degrees).

As its name implies it uses Timer2 so it may meet your needs.

...R