exit status 1 - Erro de compilando para a placa

***** 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);
}

 #error "This chip is not supported!"

The error is pretty clear if you ask me.

The library you're using uses low-level register access to configure timers and prescalers to configure the PWM. The register code is specific to the Arduino UNO (?) and it doesn't support the Arduino Leonardo.

Pieter

Obrigado.

Então tenho que trocar de placa ?

You could do that, but switching to a different stepper motor library is going to be much easier.

By the way, this is the English part of the forum, if you don't speak English, you can ask the moderator to move this to the Portuguese section of the forum.

Either change board, or change library.

Is that the latest version of that library? It's weird that they wouldn't support the 32u4 based boards. Adafruit sells a bunch of boards based on that chip, and theres np technical reason why they couldn't have supported the 32u4 (used on Leo, micro, and a bunch of third party boards)

That is a completely out of date library for a discontinued shield.

This is the current library for current hardware:

Which motor shield do you have?