forked from reprappro/RepRapFirmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Move.ino
60 lines (46 loc) · 1.17 KB
/
Move.ino
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
/****************************************************************************************************
RepRapFirmware - Move
This is all the code to deal with movement and kinematics.
-----------------------------------------------------------------------------------------------------
Version 0.1
18 November 2012
Adrian Bowyer
RepRap Professional Ltd
http://reprappro.com
Licence: GPL
****************************************************************************************************/
#include "RepRapFirmware.h"
Move::Move(Platform* p)
{
//Serial.println("Move constructor");
platform = p;
active = false;
}
void Move::Init()
{
lastTime = platform->Time();
platform->SetDirection(X_AXIS, FORWARDS);
platform->SetDirection(Y_AXIS, FORWARDS);
platform->SetDirection(Z_AXIS, FORWARDS);
platform->SetDirection(3, FORWARDS);
active = true;
}
void Move::Exit()
{
active = false;
}
void Move::Spin()
{
if(!active)
return;
unsigned long t = platform->Time();
if(t - lastTime < 300)
return;
lastTime = t;
//Serial.println("tick");
/* platform->step(X_AXIS);
platform->step(Y_AXIS);
platform->step(Z_AXIS);
platform->step(3);
*/
}