Problemi con software servo (RISOLTO)

Buongiorno a tutti,

ho scaricato questo firmware: GitHub - zaggo/SphereBot: Arduino Firmware for the SphereBot, an EggBot inspired robot
che serve a controllare una spherebot.
Il software è un po datato e necessita delle librerie softwareservo: Arduino Playground - Servo e TimerOne: Arduino Playground - Timer1

Le copio nella cartella progetto, sostituisco Wprogram.h con Arduino.h e faccio la compilazione
Su software servo mi torna questo errore:

SoftwareServo.cpp:3: error: expected constructor, destructor, or type conversion before ‘*’ token
SoftwareServo.cpp:7: error: ‘SoftwareServo’ has not been declared
SoftwareServo.cpp:7: error: ISO C++ forbids declaration of ‘SoftwareServo’ with no type
SoftwareServo.cpp: In function ‘int SoftwareServo()’:
SoftwareServo.cpp:7: error: only constructors take base initializers
SoftwareServo.cpp: At global scope:
SoftwareServo.cpp:10: error: ‘SoftwareServo’ is not a class or namespace
SoftwareServo.cpp:10: error: variable or field ‘setMinimumPulse’ declared void
SoftwareServo.cpp:10: error: ‘uint16_t’ was not declared in this scope
SoftwareServo.cpp:15: error: ‘SoftwareServo’ is not a class or namespace
SoftwareServo.cpp:15: error: variable or field ‘setMaximumPulse’ declared void
SoftwareServo.cpp:15: error: ‘uint16_t’ was not declared in this scope
SoftwareServo.cpp:20: error: ‘uint8_t’ does not name a type
SoftwareServo.cpp:32: error: ‘SoftwareServo’ is not a class or namespace
SoftwareServo.cpp: In function ‘void detach()’:
SoftwareServo.cpp:34: error: ‘p’ was not declared in this scope
SoftwareServo.cpp:34: error: ‘first’ was not declared in this scope
SoftwareServo.cpp:35: error: invalid use of ‘this’ in non-member function
SoftwareServo.cpp:36: error: invalid use of ‘this’ in non-member function
SoftwareServo.cpp:37: error: invalid use of ‘this’ in non-member function
SoftwareServo.cpp: At global scope:
SoftwareServo.cpp:43: error: ‘SoftwareServo’ is not a class or namespace
SoftwareServo.cpp: In function ‘void write(int)’:
SoftwareServo.cpp:47: error: ‘angle’ was not declared in this scope
SoftwareServo.cpp:51: error: ‘pulse0’ was not declared in this scope
SoftwareServo.cpp:51: error: ‘min16’ was not declared in this scope
SoftwareServo.cpp:51: error: ‘clockCyclesPerMicrosecond’ was not declared in this scope
SoftwareServo.cpp:51: error: ‘max16’ was not declared in this scope
SoftwareServo.cpp: At global scope:
SoftwareServo.cpp:54: error: ‘uint8_t’ does not name a type
SoftwareServo.cpp:59: error: ‘uint8_t’ does not name a type
SoftwareServo.cpp:67: error: ‘SoftwareServo’ is not a class or namespace
SoftwareServo.cpp: In function ‘void refresh()’:
SoftwareServo.cpp:69: error: ‘uint8_t’ was not declared in this scope
SoftwareServo.cpp:69: error: expected ;' before ‘count’ SoftwareServo.cpp:70: error: ‘uint16_t’ was not declared in this scope SoftwareServo.cpp:70: error: expected ;' before ‘base’
SoftwareServo.cpp:71: error: ‘p’ was not declared in this scope
SoftwareServo.cpp:73: error: ‘millis’ was not declared in this scope
SoftwareServo.cpp:79: error: ‘first’ was not declared in this scope
SoftwareServo.cpp:79: error: ‘count’ was not declared in this scope
SoftwareServo.cpp:80: error: ‘count’ was not declared in this scope
SoftwareServo.cpp:83: error: ‘s’ was not declared in this scope
SoftwareServo.cpp:83: error: ‘count’ was not declared in this scope
SoftwareServo.cpp:84: error: ‘i’ was not declared in this scope
SoftwareServo.cpp:88: error: expected ;' before ‘moved’ SoftwareServo.cpp:89: error: ‘i’ was not declared in this scope SoftwareServo.cpp:91: error: ‘t’ was not declared in this scope SoftwareServo.cpp:94: error: ‘moved’ was not declared in this scope SoftwareServo.cpp:97: error: ‘moved’ was not declared in this scope SoftwareServo.cpp:106: error: ‘i’ was not declared in this scope SoftwareServo.cpp:106: error: ‘digitalWrite’ was not declared in this scope SoftwareServo.cpp:108: error: expected ;' before ‘start’
SoftwareServo.cpp:109: error: expected ;' before ‘now’ SoftwareServo.cpp:110: error: expected ;' before ‘last’
SoftwareServo.cpp:114: error: expected `;' before ‘go’
SoftwareServo.cpp:118: error: ‘now’ was not declared in this scope
SoftwareServo.cpp:118: error: ‘TCNT0’ was not declared in this scope
SoftwareServo.cpp:119: error: ‘last’ was not declared in this scope
SoftwareServo.cpp:119: error: ‘base’ was not declared in this scope
SoftwareServo.cpp:120: error: ‘last’ was not declared in this scope
SoftwareServo.cpp:122: error: ‘base’ was not declared in this scope
SoftwareServo.cpp:122: error: ‘go’ was not declared in this scope
SoftwareServo.cpp:123: error: ‘digitalWrite’ was not declared in this scope

Come posso risolverlo?
Grazie a tutti!
Ivan Bortolin

le librerie vanno copiate nella cartella libraries dell'ide di arduino, non nella cartella del progetto

magari questa info ti aiuta...

Ho provato a copiare le cartelle nella cartella libreries di Arduino. Ora mi torna questo errore:

SphereBot.cpp.o: In function setup': /home/nextor/Programmi/arduino-1.0.5/SphereBot.ino:123: undefined reference to SoftwareServo::SoftwareServo()'
/home/nextor/Programmi/arduino-1.0.5/SphereBot.ino:123: undefined reference to SoftwareServo::refresh()' /home/nextor/Programmi/arduino-1.0.5/SphereBot.ino:123: undefined reference to SoftwareServo::refresh()'
/home/nextor/Programmi/arduino-1.0.5/SphereBot.ino:123: undefined reference to SoftwareServo::write(int)' /home/nextor/Programmi/arduino-1.0.5/SphereBot.ino:123: undefined reference to SoftwareServo::refresh()'
/home/nextor/Programmi/arduino-1.0.5/SphereBot.ino:123: undefined reference to SoftwareServo::write(int)' /home/nextor/Programmi/arduino-1.0.5/SphereBot.ino:96: undefined reference to SoftwareServo::refresh()'
/home/nextor/Programmi/arduino-1.0.5/SphereBot.ino:100: undefined reference to SoftwareServo::attach(int)' /home/nextor/Programmi/arduino-1.0.5/SphereBot.ino:101: undefined reference to SoftwareServo::write(int)'
/home/nextor/Programmi/arduino-1.0.5/SphereBot.ino:107: undefined reference to SoftwareServo::refresh()' /home/nextor/Programmi/arduino-1.0.5/SphereBot.ino:113: undefined reference to Timer1'
/home/nextor/Programmi/arduino-1.0.5/SphereBot.ino:113: undefined reference to Timer1' /home/nextor/Programmi/arduino-1.0.5/SphereBot.ino:113: undefined reference to TimerOne::initialize(long)'
/home/nextor/Programmi/arduino-1.0.5/SphereBot.ino:114: undefined reference to Timer1' /home/nextor/Programmi/arduino-1.0.5/SphereBot.ino:114: undefined reference to Timer1'
/home/nextor/Programmi/arduino-1.0.5/SphereBot.ino:114: undefined reference to `TimerOne::attachInterrupt(void (*)(), long)'

Secondo voi è possibile sostituire questo software servo con servo.h?

Sbagli a mettere le cartelle varie. Io ho provato e dopo aver sostituito i vari WProgram.h con Arduino.h mi compila.

La mia cartella degli sketch è questa: H:\Arduino_projects
librerie: H:\Arduino_projects\LIBRARIES

perciò:
H:\Arduino_projects\SphereBot
e qui dentro ci deve essere SphereBot.ino (rinominato da .dpe) , StepperModel.h e StepperModel.cpp (in questo c'e' WProgram.h)

H:\Arduino_projects\LIBRARIES\TimerOne
con dentro TimerOne.h e TimerOne.cpp

H:\Arduino_projects\LIBRARIES\SoftwareServo
con dentro SoftwareServo.cpp e SoftwareServo.h (in questo c'e' WProgram.h)

Grazie mille ad entrambi! L'ultimo suggerimento è stata la soluzione del problema! :smiley: :smiley: :smiley:
Ivan