기본 라이브러리 사용한 겁니다.
#include <Stepper.h>
#include <value.h>
#include <My_Arduino_GPIO_Lib_V1_8.h>
#include "st_motor.h"
const int step_reg = 2048; // 분해능
Stepper st_motor(step_reg, 8, 10, 9, 11); // a, b, /a, /b
void setup() {
// put your setup code here, to run once:
//st_init();
st_motor.setSpeed(18); //Speed
}
void loop() {
// put your main code here, to run repeatedly:
// 실습2 = 가감속 제어하기 = 별도 라이브러리 설치해야
// 실습 1 = 기본돌리기 = 기존 라이브러리 사용
// cw
st_motor.step(step_reg);
delay(1000);
// CCW
st_motor.step(-step_reg);
delay(1000);
}
첨부파일첨부된 파일이 1개 있습니다.
다음검색
스크랩 원문 :
마이크로프로세서 제어 연구실