-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstepper.h
52 lines (44 loc) · 1.35 KB
/
stepper.h
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
// #include <Arduino.h>
// class cTrapezoidStepper
// {
// public:
// cTrapezoidStepper( Stepper& stepper, int32_t accel, int32_t vmax, int32_t decel, int32_t range ) :
// m_stepper( stepper ),
// m_accel( accel ),
// m_vmax( vmax ),
// m_vpeak( 0 ),
// m_decel( decel ),
// m_range( range ),
// m_start_time( 0 ),
// m_current_pos( 0 ),
// m_target_delta( 0 ),
// m_direction( 0 ),
// m_distance_moved( 0 ),
// m_trap_phase( STOP )
// {
// }
// bool isMoving() ;
// int32_t setTargetPos( int32_t target );
// int32_t update() ;
// private :
// static const int32_t ONE_SECOND = 100 ;
// Stepper& m_stepper ;
// int32_t m_accel ;
// int32_t m_vmax ;
// int32_t m_vpeak ;
// int32_t m_decel ;
// int32_t m_range ;
// unsigned long m_start_time ;
// int32_t m_current_pos ;
// int32_t m_target_delta ;
// int32_t m_direction ;
// int32_t m_distance_moved ;
// enum
// {
// STOP,
// ACCEL,
// CONSTANT,
// DECEL
// } m_trap_phase ;
// int32_t tick(){ return millis() / (1000 / ONE_SECOND) ; }
// };