Pages: [1]   Go Down
Author Topic: ServoDecode Library in Arduino 1.0  (Read 2042 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Will the ServoDecode library work with Arduino 1.0 on a Uno R3 (on a Windows 7 PC)?  Each time I try to compile I get an error message:

C:\Users\Owner\Desktop\Projects\Solair\arduino-1.0\libraries\ServoDecode\ServoDecode.cpp:3:18: error: wiring.h: No such file or directory
C:\Users\Owner\Desktop\Projects\Solair\arduino-1.0\libraries\ServoDecode\ServoDecode.cpp: In member function 'void ServoDecodeClass::begin()':
ServoDecode.pde:-1: error: 'INPUT' was not declared in this scope
ServoDecode.pde:-1: error: 'pinMode' was not declared in this scope

I'm not sure what modifications to the .cpp or .h file I might need to fix this.  Any help would be appreciated.
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 178
Posts: 8064
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In Arduino 1.0 the "wiring.h" file has been replaced by "Arduino.h".  Often that is the only change needed to get a pre-1.0 library working with 1.0.  Try making that change in ServoDecode.cpp
« Last Edit: October 21, 2012, 09:36:53 am by johnwasser » Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,
as I would like to read in a PPM-Signal by using Interrupts I am also trying to work with the ServoDecode class in Arduino 1.0.1, as copied from http://arduino.cc/forum/index.php/topic,22140.0.html . But I (also) get the errors

ServoDecode.cpp: In member function 'void ServoDecodeClass::begin()':
ServoDecode.cpp:76: error: 'INPUT' was not declared in this scope
ServoDecode.cpp:76: error: 'pinMode' was not declared in this scope
ServoDecode.cpp:81: error: 'TIMSK1' was not declared in this scope
ServoDecode.cpp:81: error: 'ICIE1' was not declared in this scope

Does anyone can help?

Greetings

Jan
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 178
Posts: 8064
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Adding
Code:
#include <Arduino.h>
to the ServoDecode.H file right after
Code:
#include <inttypes.h>
fixes that problem.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Dubai, UAE
Offline Offline
Edison Member
*
Karma: 21
Posts: 1670
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

There is always this -

http://rcarduino.blogspot.com/2012/01/how-to-read-rc-receiver-with.html

and

http://rcarduino.blogspot.com/2012/04/how-to-read-multiple-rc-channels-draft.html

Duane B

rcarduino.blogspot.com
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I getting the same problem. Did you manage to find the solution?
Logged

Dubai, UAE
Offline Offline
Edison Member
*
Karma: 21
Posts: 1670
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What do you want to read, individual channels or a pulse stream containing all of the channels, I have code for both options which is used by many people and is also compatible with the standard servo library for generating your outputs.

Duane B

rcarduino.blogspot.com
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
thanks a lot. It worked with adding #include <Arduino.h>. The other problems came because i am using a myavr board with an Atmega8.

I want to read the PPM-Stream from a RC-Reciever.

Greetings

Jan
Logged

Pages: [1]   Go Up
Jump to: