***** Não consigo prosseguir por causa deste erro. *****
Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Placa:"Arduino Leonardo"
C:\Users\lucas\Documents\Arduino\libraries\Adafruit_Motor_Shield_library\AFMotor.cpp:136:5: error: #error "This chip is not supported!"
#error "This chip is not supported!"
^~~~~
C:\Users\lucas\Documents\Arduino\libraries\Adafruit_Motor_Shield_library\AFMotor.cpp:173:5: error: #error "This chip is not supported!"
#error "This chip is not supported!"
^~~~~
C:\Users\lucas\Documents\Arduino\libraries\Adafruit_Motor_Shield_library\AFMotor.cpp:205:5: error: #error "This chip is not supported!"
#error "This chip is not supported!"
^~~~~
C:\Users\lucas\Documents\Arduino\libraries\Adafruit_Motor_Shield_library\AFMotor.cpp:226:5: error: #error "This chip is not supported!"
#error "This chip is not supported!"
^~~~~
C:\Users\lucas\Documents\Arduino\libraries\Adafruit_Motor_Shield_library\AFMotor.cpp:259:5: error: #error "This chip is not supported!"
#error "This chip is not supported!"
^~~~~
C:\Users\lucas\Documents\Arduino\libraries\Adafruit_Motor_Shield_library\AFMotor.cpp:279:5: error: #error "This chip is not supported!"
#error "This chip is not supported!"
^~~~~
C:\Users\lucas\Documents\Arduino\libraries\Adafruit_Motor_Shield_library\AFMotor.cpp:314:5: error: #error "This chip is not supported!"
#error "This chip is not supported!"
^~~~~
C:\Users\lucas\Documents\Arduino\libraries\Adafruit_Motor_Shield_library\AFMotor.cpp:334:5: error: #error "This chip is not supported!"
#error "This chip is not supported!"
^~~~~
In file included from c:\users\lucas\documents\arduinodata\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\io.h:99:0,
from c:\users\lucas\documents\arduinodata\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\pgmspace.h:90,
from C:\Users\lucas\Documents\ArduinoData\packages\arduino\hardware\avr\1.8.1\cores\arduino/Arduino.h:28,
from C:\Users\lucas\Documents\Arduino\libraries\Adafruit_Motor_Shield_library\AFMotor.cpp:7:
C:\Users\lucas\Documents\Arduino\libraries\Adafruit_Motor_Shield_library\AFMotor.cpp: In constructor 'AF_Stepper::AF_Stepper(uint16_t, uint8_t)':
C:\Users\lucas\Documents\Arduino\libraries\Adafruit_Motor_Shield_library\AFMotor.h:43:31: error: 'CS20' was not declared in this scope
#define MOTOR12_64KHZ _BV(CS20) // no prescale
^
C:\Users\lucas\Documents\Arduino\libraries\Adafruit_Motor_Shield_library\AFMotor.h:53:33: note: in expansion of macro 'MOTOR12_64KHZ'
#define STEPPER1_PWM_RATE MOTOR12_64KHZ // PWM rate for stepper 1
^~~~~~~~~~~~~
C:\Users\lucas\Documents\Arduino\libraries\Adafruit_Motor_Shield_library\AFMotor.cpp:438:14: note: in expansion of macro 'STEPPER1_PWM_RATE'
initPWM1(STEPPER1_PWM_RATE);
^~~~~~~~~~~~~~~~~
C:\Users\lucas\Documents\Arduino\libraries\Adafruit_Motor_Shield_library\AFMotor.h:43:31: note: suggested alternative: 'CS00'
#define MOTOR12_64KHZ _BV(CS20) // no prescale
^
C:\Users\lucas\Documents\Arduino\libraries\Adafruit_Motor_Shield_library\AFMotor.h:53:33: note: in expansion of macro 'MOTOR12_64KHZ'
#define STEPPER1_PWM_RATE MOTOR12_64KHZ // PWM rate for stepper 1
^~~~~~~~~~~~~
C:\Users\lucas\Documents\Arduino\libraries\Adafruit_Motor_Shield_library\AFMotor.cpp:438:14: note: in expansion of macro 'STEPPER1_PWM_RATE'
initPWM1(STEPPER1_PWM_RATE);
^~~~~~~~~~~~~~~~~
exit status 1
Erro compilando para a placa Arduino Leonardo
Este relatório teria mais informações com
"Mostrar a saida detalhada durante a compilação"
opção pode ser ativada em "Arquivo -> Preferências"
Codigo de programação é este abaixo*
#include <AFMotor.h>
double Passos_total = 2048;
// Define As Portas Para Os Motores
// Valor 1 Para Motor Em M1/M2 E 2 Para Motor Em M3/M4
int Porta_motor_1 = 1;
int Porta_motor_2 = 2;
// Angulo De Rotacao Do Eixo
int Angulo = 45;
double numero_de_passos = 0;
// Define Os Parametros Do Motor 1
AF_Stepper Motor_de_passo_1(Passos_total, Porta_motor_1);
// Define Os Parametros Do Motor 2
AF_Stepper Motor_de_passo_2(Passos_total, Porta_motor_2);
void Setup()
{
// Define A Velocidade De Rotacao Do Motor 1
Motor_de_passo_1.setSpeed(10);
// Define A Velocidade De Rotacao Do Motor 2
Motor_de_passo_2.setSpeed(10);
// Inicializa A Serial
Serial.begin(9600);
}
void Loop()
{
// Calcula A Quantidade De Passos, Baseado No Angulo Determinado
numero_de_passos = Angulo / (360 / Passos_total);
//Mostra No Serial Monitor O Numero De Passos Calculados
Serial.print("numero de passos : ");
Serial.println(numero_de_passos);
//Move O Motor 1. Use FORWARD Para Sentido Horario,
//BACKWARD Para Anti-Horario
Motor_de_passo_1.step(numero_de_passos, FORWARD, SINGLE);
Motor_de_passo_1.release();
delay(10);
//Move O Motor 1. Use FORWARD Para Sentido Horario,
//BACKWARD Para Anti-Horario
Motor_de_passo_2.step(numero_de_passos, BACKWARD, SINGLE);
Motor_de_passo_2.release();
delay(500);
}