-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.c
51 lines (42 loc) · 832 Bytes
/
main.c
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
46
47
48
49
50
51
#include <stm32f10x.h>
#include "delay.h"
#include "sys.h"
#include "usart.h"
#include "A4988.h"
#include "42Stepper.h"
/*
版权所有:
作者:林愿留
*/
int main()
{
delay_init(); //延时函数初始化
NVIC_Configuration(); //设置NVIC中断分组2:2位抢占优先级,2位响应优先级
uart_init(9600); //串口初始化为9600
initA4988();
setDirection(CW);
setMicrostep(SIXTEENTH_STEP);
while(1)
{
// if(getRunplusestatue() == RUN_OVER)
// {
// rotateMinangle();
// if(checkangle(MINANGLE) == false)
// {
// setDirection(!DIR_A4988);
// }
// }
//oneStep(CW);
delay_ms(1000);
moveNmm(10);
// oneStep(CW);
// Spin motor one rotation slowly
//for(int x = 0; x < STEPS_PER_REV; x++) {
// STEP_A4988 = 1;
// delay_ms(t);
// STEP_A4988 = 0;
// delay_ms(t);
//}
//delay_ms(1000);
}
}