edgarman2 / arduino-ppm-servo

Automatically exported from code.google.com/p/arduino-ppm-servo
0 stars 0 forks source link

Library does not work with Leonardo boards #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Select Leonardo board as a target
2. Enter the following sketch and compile:

#include <ServoTimer2.h>
ServoTimer2 a;
void setup()
{
   a.attach(5);
}
void loop()
{
  a.write(1500);
} 

The output shows an error:
C:\Users\User1\Documents\Arduino\libraries\ServoTimer2/ServoTimer2.h:3:1: 
warning: "/*" within comment
C:\Autopilot\Arduino\arduino-105\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall 
-fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega32u4 
-DF_CPU=16000000L -MMD -DUSB_VID=0x2341 -DUSB_PID=0x8036 -DARDUINO=105 
-IC:\Autopilot\Arduino\arduino-105\hardware\arduino\cores\arduino 
-IC:\Autopilot\Arduino\arduino-105\hardware\arduino\variants\leonardo 
-IC:\Users\User1\Documents\Arduino\libraries\ServoTimer2 
-IC:\Users\User1\Documents\Arduino\libraries\ServoTimer2\utility 
C:\Users\User1\Documents\Arduino\libraries\ServoTimer2\ServoTimer2.cpp -o 
C:\Users\User1\AppData\Local\Temp\build2195581623929243517.tmp\ServoTimer2\Servo
Timer2.cpp.o 
In file included from 
C:\Users\User1\Documents\Arduino\libraries\ServoTimer2\ServoTimer2.cpp:15:
C:\Users\User1\Documents\Arduino\libraries\ServoTimer2\/ServoTimer2.h:3:1: 
warning: "/*" within comment
C:\Users\User1\Documents\Arduino\libraries\ServoTimer2\ServoTimer2.cpp:31: 
warning: 'TIMER2_OVF_vect' appears to be a misspelled signal handler
C:\Users\User1\Documents\Arduino\libraries\ServoTimer2\ServoTimer2.cpp: In 
function 'void TIMER2_OVF_vect()':
C:\Users\User1\Documents\Arduino\libraries\ServoTimer2\ServoTimer2.cpp:36: 
error: 'TCNT2' was not declared in this scope
C:\Users\User1\Documents\Arduino\libraries\ServoTimer2\ServoTimer2.cpp:46: 
error: 'TCNT2' was not declared in this scope

Original issue reported on code.google.com by nicki...@gmail.com on 16 Jan 2014 at 8:09

GoogleCodeExporter commented 9 years ago
I have the same problem. It is enough to insert the "#include <ServoTimer2.h>" 
line, without any specific code. If you select UNO board it compiles ok. 
Selecting Leonardo you get those errors.
I'm surprised nobody else found this bug (is it a bug?) I spent days trying to 
find an answer on the net without any success

Original comment by fabrizio...@gmail.com on 8 Apr 2014 at 8:47