#1 2017-01-05 18:26:47

glory24
Учасник
З Киев
Зареєстрований: 2017-01-01
Повідомлень: 15

При компилировании выдает ошибку

BasicStepperDriver.ino:12:32: error: BasicStepperDriver.h: No such file or directory
BasicStepperDriver:28: error: 'BasicStepperDriver' does not name a type
BasicStepperDriver.ino: In function 'void setup()':
BasicStepperDriver:39: error: 'stepper' was not declared in this scope
BasicStepperDriver.ino: In function 'void loop()':
BasicStepperDriver:51: error: 'stepper' was not declared in this scope

Компилирую в Arduino 1.0.5
Скетч BasicStepperDriver из библиотеки StepperDriver
BasicStepperDriver.h как и положено лежит в папочке C:\Arduino\Arduino\libraries\StepperDriver\src


Ошибку выдает на эту строчку из скетча: BasicStepperDriver stepper(MOTOR_STEPS, DIR, STEP);

Этот же скетч в Arduino 1.6.12 проходит компиляцию без проблем
Как полечить Arduino 1.0.5 ?

Остання редакція glory24 (2017-01-05 19:32:49)

Неактивний

#2 2017-01-05 19:05:55

qwone
Учасник
Зареєстрований: 2016-07-25
Повідомлень: 143

Re: При компилировании выдает ошибку

glory24 пише:

BasicStepperDriver.ino:12:32: error: BasicStepperDriver.h: No such file or directory

Название файла .ino и файла .h не должны совпадать.
No such file or directory - переводчик в руки- нет файла или директории.
А дальше следсвие.

Неактивний

#3 2017-01-05 22:10:43

glory24
Учасник
З Киев
Зареєстрований: 2017-01-01
Повідомлень: 15

Re: При компилировании выдает ошибку

qwone пише:
glory24 пише:

BasicStepperDriver.ino:12:32: error: BasicStepperDriver.h: No such file or directory

Название файла .ino и файла .h не должны совпадать.
No such file or directory - переводчик в руки- нет файла или директории.
А дальше следсвие.

Переназвал файл .ino, теперь ругается так:

BasicStepperDriver8825.ino:12:32: error: BasicStepperDriver.h: No such file or directory
BasicStepperDriver8825:28: error: 'BasicStepperDriver' does not name a type
BasicStepperDriver8825.ino: In function 'void setup()':
BasicStepperDriver8825:39: error: 'stepper' was not declared in this scope
BasicStepperDriver8825.ino: In function 'void loop()':

3d8wrMbkFnDtmJTF7

картинка открывается правой кнопкой мышки
вот код

/*
 * Simple demo, should work with any driver board
 *
 * Connect STEP, DIR as indicated
 *
 * Copyright (C)2015 Laurentiu Badea
 *
 * This file may be redistributed under the terms of the MIT license.
 * A copy of this license has been included with this distribution in the file LICENSE.
 */
#include <Arduino.h>
#include "BasicStepperDriver.h"

// Motor steps per revolution. Most steppers are 200 steps or 1.8 degrees/step
#define MOTOR_STEPS 200

// All the wires needed for full functionality
#define DIR 9
#define STEP 8
//Uncomment line to use enable/disable functionality
//#define ENBL 7

// Since microstepping is set externally, make sure this matches the selected mode
// 1=full step, 2=half step etc.
#define MICROSTEPS 1

// 2-wire basic config, microstepping is hardwired on the driver
BasicStepperDriver stepper(MOTOR_STEPS, DIR, STEP);

//Uncomment line to use enable/disable functionality
//BasicStepperDriver stepper(MOTOR_STEPS, DIR, STEP, ENBL);

void setup() {
    /*
     * Set target motor RPM.
     * These motors can do up to about 200rpm.
     * Too high will result in a high pitched whine and the motor does not move.
     */
    stepper.setRPM(5);// скорость вращения
}

void loop() {
  
    // energize coils - the motor will hold position
    // stepper.enable();
  
    /*
     * Tell the driver the microstep level we selected.
     * If mismatched, the motor will move at a different RPM than chosen.
     */
    stepper.setMicrostep(MICROSTEPS);

    /*
     * Moving motor one full revolution using the degree notation
     */
    stepper.rotate(30);// Угол поворота

    /*
     * Moving motor to original position using steps
     */
   //stepper.move(-200*MICROSTEPS);// Возврат на 200 шагов

    // pause and allow the motor to be moved by hand
    // stepper.disable();

    delay(3000);
}

Остання редакція glory24 (2017-01-05 22:34:41)

Неактивний

#4 2017-01-18 04:28:52

dev3
Учасник
Зареєстрований: 2017-01-18
Повідомлень: 1

Re: При компилировании выдает ошибку

Вместо #include "BasicStepperDriver.h" должно быть #include <BasicStepperDriver.h>

Неактивний

Швидке повідомлення

Введіть повідомлення і натисніть Надіслати

Підвал форуму