Arduino Uno to control multiple servo's and Wave Shield

Hi everyone,

I've been working on a project with my partner to control a servo and wave shield with an Arduino Uno R3 for use in enhancing a fursuit with noises and movement. However, I'm having some troubles with the code which I am unable to fix myself.

Basically, I had to reassign a new library for the servos as the Wave Shield didn't like the one I was currently using for them, that was no problem as someone had written code for this and I replaced it. Now though I am trying to program the Wave Shield to play various sound files on the SD card at the press of a button (well, 4 to be precise) but I get these errors:

C:\Users\Nick\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp: In member function 'uint8_t SoftwareServo::attach(int)':
C:\Users\Nick\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:27:23: error: 'digitalWrite' was not declared in this scope
digitalWrite(pin,0);
^
C:\Users\Nick\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:28:17: error: 'OUTPUT' was not declared in this scope
pinMode(pin,OUTPUT);
^
C:\Users\Nick\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:28:23: error: 'pinMode' was not declared in this scope
pinMode(pin,OUTPUT);
^
C:\Users\Nick\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp: In member function 'void SoftwareServo::write(int)':
C:\Users\Nick\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:51:51: error: 'clockCyclesPerMicrosecond' was not declared in this scope
pulse0 = (min1616LclockCyclesPerMicrosecond() + (max16-min16)(16LclockCyclesPerMicrosecond())angle/180L)/64L;
^
C:\Users\Nick\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp: In static member function 'static void SoftwareServo::refresh()':
C:\Users\Nick\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:73:30: error: 'millis' was not declared in this scope
unsigned long m = millis();
^
C:\Users\Nick\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:106:60: error: 'digitalWrite' was not declared in this scope
for ( i = 0; i < count; i++) digitalWrite( s
->pin, 1);*

  • ^*
    C:\Users\Nick\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:108:21: error: 'TCNT0' was not declared in this scope
  • uint8_t start = TCNT0;*
  • ^*
    C:\Users\Nick\Documents\Arduino\libraries\SoftwareServo\SoftwareServo.cpp:123:28: error: 'digitalWrite' was not declared in this scope
    _ digitalWrite( s*->pin,0);_
    _
    ^_
    Multiple libraries were found for "SoftwareServo.h"
    Used: C:\Users\Nick\Documents\Arduino\libraries\SoftwareServo
    Not used: C:\Users\Nick\Documents\Arduino\libraries\WaveHC
    Error compiling.
    Attached is the code of the "SoftwareServo.cpp", if you require a copy of the script I use for the Uno, let me know and I will post it ASAP!
    Any help here please? If there is a thread that solves this problem or one like it, the link would be very much appreciated!
    Many thanks for any help/advice/tips!
    _
    SoftwareServo.cpp (3.18 KB)*_

What does SoftwareServo.h look like? Does it (properly) include Arduino.h?

Here is the content of SoftwareServo.h:

#ifndef SoftwareServo_h
#define SoftwareServo_h

#include <WProgram.h>
#include <inttypes.h>

class SoftwareServo
{
private:
uint8_t pin;
uint8_t angle; // in degrees
uint16_t pulse0; // pulse width in TCNT0 counts
uint8_t min16; // minimum pulse, 16uS units (default is 34)
uint8_t max16; // maximum pulse, 16uS units, 0-4ms range (default is 150)
class SoftwareServo next;
static SoftwareServo
first;
public:
SoftwareServo();
uint8_t attach(int); // attach to a pin, sets pinMode, returns 0 on failure, won't
// position the servo until a subsequent write() happens
void detach();
void write(int); // specify the angle in degrees, 0 to 180
uint8_t read();
uint8_t attached();
void setMinimumPulse(uint16_t); // pulse length for 0 degrees in microseconds, 540uS default
void setMaximumPulse(uint16_t); // pulse length for 180 degrees in microseconds, 2400uS default
static void refresh(); // must be called at least every 50ms or so to keep servo alive
// you can call more often, it won't happen more than once every 20ms
};

#endif

If I replace "#include <WProgram.h>" with <Arduino.h> it says "no such file or directory exists, which it currently says for WProgram.h
However I have just realised that WProgram.h is actually empty, just 2 empty lines which is odd as I copied and pasted the correct text into it and saved... I'll try that again now and see if this changes much

Do NOT try to create a WProgram.h file. The correct file to include is Arduino.h. Do NOT post a bunch of handwaving. Post the modified cade and the EXACT error messages.