반응형
https://cafe.naver.com/easyrobot/6963
<설명>
HHH : 점퍼를 모두 연결한 상태
아두이노 <> A4988
#1 D6 ENABLE
(FULL Step)
#2 NC MS1
#3 NC MS2
#4 NC MS3
(1/16 step)
#2 5V MS1
#3 5V MS2
#4 5V MS3
#5, #6 RESET <-> SLEEP
#7 D5~ STEP
#8 D4 DIR
#9 GND GND
#10 5V VDD
#11 1B >모터
#12 1A >모터
#13 2A >모터
#14 2B >모터
#15 GND GND(MOT)
#16 8~35V VMOT
<소스>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
/**************************************************************************************
* 작성일 : 2017.11.14
* 작성자 : 이지로봇학원
* 제 목 : A4988 Driver 와 28BYJ48 Step Motor를 이용한 아날로그 시계 초침구현하기
**************************************************************************************/
// FILENAME: 28BYJ48_a4988_analogclock.ino
//28BYJ BLUE --- A4988 11 1B
//28BYJ YELL --- A4988 12 1A
//28BYJ PINK --- A4988 13 2A
//28BYJ BLUE --- A4988 14 2B
//VCC----------- A4988 10
//GND----------- A4988 9
//PULLUP-------- A4988 5 /RES
int Index;
const long interval = 1000;
unsigned long previousMillis = 0;
void setup()
{
Serial.begin( 9600 );
pinMode(6, OUTPUT); //Enable A4988 1 Low Active
pinMode(5, OUTPUT); //Step A4988 7
pinMode(4, OUTPUT); //Direction A4988 8
unsigned long previousMillis = 0; // will store last time LED was updated
digitalWrite(6,LOW); //Enable Low Active
}
void loop()
{
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= interval){
previousMillis = currentMillis;
digitalWrite(4,LOW); //CW
for(Index = 0; Index < 64*32/60; Index++){
digitalWrite(5,HIGH);
delayMicroseconds(1024);
digitalWrite(5,LOW);
delayMicroseconds(1024);
}
}else{
delayMicroseconds(1024);
}
}
|
<결과>
반응형
'프로세싱+아두이노+안드로이드' 카테고리의 다른 글
How To Control a Stepper Motor with A4988 Driver and Arduino (0) | 2022.05.23 |
---|---|
A4988 드라이버와 Arduino로 스테퍼 모터를 제어하는 방법 (전류제한) (0) | 2022.05.23 |
Adafruit GFX Graphics Library (0) | 2022.05.14 |
Understanding the Pull-up/Pull-down Resistors With Arduino (0) | 2022.05.14 |
마이크모듈 MAX9814 - Adafruit AGC Electret Microphone Amplifier (0) | 2022.05.14 |
댓글