-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
40 lines (34 loc) · 829 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
#include <pic18f4520.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <xc.h>
#include "setting_hardaware/include/motion.h"
#include "setting_hardaware/include/setting.h"
#include "setting_hardaware/include/config.h"
// command example: #21P2500T5000\r\n
void main() {
SYSTEM_Initialize();
int walk_state = 0;
while(1) {
if(isWalk){
Motion_Walk(walk_state);
walk_state = (walk_state + 1) % 6;
}
else if(!isAdc){
Motion_WalkInit();
walk_state = 0;
}
}
/*while (1) {
if(isWalk){
Motion_Walk(walk_state);
walk_state = (walk_state + 1) % 4;
}else{
Motion_Stand();
walk_state = 0;
}
}*/
return;
}