-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
96 lines (81 loc) · 2.06 KB
/
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
* Template dsPIC33F
* Compiler : Microchip xC16
* µC : 33FJ128MC804
* Mars 2016
*
* ______ _____ _ _
* |___ /| ___ \ | | | |
* / / | |_/ /___ | |__ ___ | |_
* / / | // _ \| '_ \ / _ \| __|
* / / | |\ \ (_) | |_) | (_) | |_
* /_/ |_| \_\___/|____/ \___/'\__|
* 7robot.fr
*/
/********Headers********/
#include <xc.h>
/******************************************************************************/
/* Configuration */
/******************************************************************************/
#include <stdint.h> // Includes uint16_t definition
#include <stdio.h> // Includes sprintf
#include <stdbool.h> // Includes true/false definition
#include "main.h"
void reglage_asserv(void);
int main(int argc, char** argv) {
Init_All(0);
//reglage_asserv();
while (1)
{
//Gestion_IO_AU_Loop();
// PWM_Moteurs(50,0); // max à 50 %...
}
}
void reglage_asserv(void)
{
//while (PIN_LAISSE);
Position Pos0, Pos1, Pos2, Pos3;
Pos0.x = 0;
Pos0.y = 0;
Pos1.x = 0.5;
Pos1.y = 0;
Pos2.x = 0.5;
Pos2.y = 0.5;
Pos3.x = 0;
Pos3.y = 0.5;
motion_pos(Pos1);
while(!motion_done());
motion_pos(Pos2);
while(!motion_done());
motion_pos(Pos3);
while(!motion_done());
motion_pos(Pos0);
while(!motion_done());
motion_pos(Pos1);
while(!motion_done());
motion_pos(Pos2);
while(!motion_done());
motion_pos(Pos3);
while(!motion_done());
motion_pos(Pos0);
while(!motion_done());
}
void Debug_Asserv_Start(void)
{
while (PIN_LAISSE);
Position pos1 = {0.40,0,0};
Position pos2 = {0.40,0.40,0};
motion_push(pos1,0.15);
motion_push(pos2,0);
//motion_speed(MOVE);
}
void Debug_Asserv_Start2(void)
{
while (PIN_LAISSE);
Position pos1 = {0.40,0,0};
Position pos2 = {0.40,0.40,0};
motion_pos(pos1);
while(!motion_done());
motion_pos(pos2);
//motion_speed(MOVE);
}