When recently helping a customer get some new Arduino code updated, I was reminded of an issue using their standard SoftwareServo library working. The customer was confronted with some error messages like the ones below

C:\arduino-1.0.1\libraries\SoftwareServo\SoftwareServo.cpp: In member function 'uint8_t SoftwareServo::attach(int)':

This is due to a compatibility issue between the library and newer versions of the Arduino IDE. What’s happening is that the base level Arduino defines and functions are not properly included in the SoftwareServo header file. It’s pointing to the old header file WProgram.h that no longer exists and it needs to be updated to Arduino.h.

Simply update this line at the beginning of SoftwareServo.h

#include <WProgram.h>

To this, and you will be back up and running

#include "Arduino.h"

0 Comments

Leave a reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

©2024 SDRobots.com | All rights reserved.

Log in with your credentials

or    

Forgot your details?

Create Account