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