Pages: [1]   Go Down
Author Topic: servotimer2 problems  (Read 939 times)
0 Members and 1 Guest are viewing this topic.
Buenos Aires, Argentina
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I installed within the libraries in a folder called ServoTimer2 the 3 files that make up the zip.
When I try to compile this simple code:

#include <ServoTimer2.h>

void setup(){}

void loop(){}


I get the following error.
/home/marcelo/arduino-1.0.3/libraries/ServoTimer2/ServoTimer2.cpp:5:26: error: WConstants.h: No existe el archivo o el directorio
/home/marcelo/arduino-1.0.3/libraries/ServoTimer2/ServoTimer2.cpp: In function ‘void __vector_9()’:
/home/marcelo/arduino-1.0.3/libraries/ServoTimer2/ServoTimer2.cpp:35: error: ‘LOW’ was not declared in this scope
/home/marcelo/arduino-1.0.3/libraries/ServoTimer2/ServoTimer2.cpp:35: error: ‘digitalWrite’ was not declared in this scope
/home/marcelo/arduino-1.0.3/libraries/ServoTimer2/ServoTimer2.cpp:42: error: ‘HIGH’ was not declared in this scope
/home/marcelo/arduino-1.0.3/libraries/ServoTimer2/ServoTimer2.cpp:42: error: ‘digitalWrite’ was not declared in this scope
/home/marcelo/arduino-1.0.3/libraries/ServoTimer2/ServoTimer2.cpp: In member function ‘uint8_t ServoTimer2::attach(int)’:
/home/marcelo/arduino-1.0.3/libraries/ServoTimer2/ServoTimer2.cpp:65: error: ‘OUTPUT’ was not declared in this scope
/home/marcelo/arduino-1.0.3/libraries/ServoTimer2/ServoTimer2.cpp:65: error: ‘pinMode’ was not declared in this scope


Thank you very much to who can guide me in the solution.

PS: Use this library to use the module VirtualWire, if they know of any better combination even better.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25770
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
WConstants.h
Substitute "Arduino.h"
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Jr. Member
**
Karma: 1
Posts: 65
controlrobotics.rodrigomompo.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have the same problem with servotimer2 when i change Wconstant to Arduino.h I had this errors

In file included from C:\Archivos de programa\Arduino\hardware\arduino\cores\arduino/Arduino.h:192,
                 from C:\Archivos de programa\Arduino\libraries\ServoTimer2\ServoTimer2.cpp:5:
C:\Archivos de programa\Arduino\hardware\arduino\cores\arduino/WString.h:116: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, const char*)' conflicts with
C:\Archivos de programa\Arduino\hardware\arduino\cores\arduino/WString.h:115: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, const String&)' here
C:\Archivos de programa\Arduino\hardware\arduino\cores\arduino/WString.h:117: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, char)' conflicts with
C:\Archivos de programa\Arduino\hardware\arduino\cores\arduino/WString.h:116: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, const char*)' here
C:\Archivos de programa\Arduino\hardware\arduino\cores\arduino/WString.h:118: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, unsigned char)' conflicts with
C:\Archivos de programa\Arduino\hardware\arduino\cores\arduino/WString.h:117: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, char)' here
C:\Archivos de programa\Arduino\hardware\arduino\cores\arduino/WString.h:119: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, int)' conflicts with
C:\Archivos de programa\Arduino\hardware\arduino\cores\arduino/WString.h:118: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, unsigned char)' here
C:\Archivos de programa\Arduino\hardware\arduino\cores\arduino/WString.h:120: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, unsigned int)' conflicts with
C:\Archivos de programa\Arduino\hardware\arduino\cores\arduino/WString.h:119: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, int)' here
C:\Archivos de programa\Arduino\hardware\arduino\cores\arduino/WString.h:121: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, long int)' conflicts with
C:\Archivos de programa\Arduino\hardware\arduino\cores\arduino/WString.h:120: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, unsigned int)' here
C:\Archivos de programa\Arduino\hardware\arduino\cores\arduino/WString.h:122: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, long unsigned int)' conflicts with
C:\Archivos de programa\Arduino\hardware\arduino\cores\arduino/WString.h:121: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, long int)' here
In file included from C:\Archivos de programa\Arduino\libraries\ServoTimer2\ServoTimer2.cpp:5:
C:\Archivos de programa\Arduino\hardware\arduino\cores\arduino/Arduino.h:196: error: declaration of C function 'uint16_t makeWord(byte, byte)' conflicts with
C:\Archivos de programa\Arduino\hardware\arduino\cores\arduino/Arduino.h:195: error: previous declaration 'uint16_t makeWord(uint16_t)' here
C:\Archivos de programa\Arduino\hardware\arduino\cores\arduino/Arduino.h:206: error: declaration of C function 'long int random(long int)' conflicts with
c:/archivos de programa/arduino/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:504: error: previous declaration 'long int random()' here
C:\Archivos de programa\Arduino\hardware\arduino\cores\arduino/Arduino.h:207: error: declaration of C function 'long int random(long int, long int)' conflicts with
C:\Archivos de programa\Arduino\hardware\arduino\cores\arduino/Arduino.h:206: error: previous declaration 'long int random(long int)' here
Logged

Visit my blog and leave some comments
controlrobotics.rodrigomompo.com

Offline Offline
Jr. Member
**
Karma: 1
Posts: 65
controlrobotics.rodrigomompo.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi I just fix the error you have to change in servoTimer2.ccp this:
Code:
extern "C" {
  // AVR LibC Includes
#include <inttypes.h
#include <avr/interrupt.h>
 #include <WConstants.h>
}
For this:
Code:
#include<Arduino.h>

If you don´t change all you will have more errors
Logged

Visit my blog and leave some comments
controlrobotics.rodrigomompo.com

Pages: [1]   Go Up
Jump to: