abdrive library  v0.5.1
Differential servo and encoder drive library for the Parallax ActivityBot
abdrive.h
Go to the documentation of this file.
1 
44 #ifndef ABDRIVE_H
45 #define ABDRIVE_H
46 
47 #if defined(__cplusplus)
48 extern "C" {
49 #endif
50 
51 #include "simpletools.h"
52 #include "simpletext.h"
53 #include "fdserial.h"
54 
55 /*
56  #ifndef interactive_development_mode
57  #define interactive_development_mode
58  void display_control_sys(int start, int end);
59  #endif
60 */
61 
62 #ifndef _ActivityBot_EE_Start_
63 
67 #define _ActivityBot_EE_Start_ 63418
68 #endif
69 
70 #ifndef _ActivityBot_EE_Pins_
71 #define _ActivityBot_EE_Pins_ 12
72 #endif
73 
74 #ifndef _ActivityBot_EE_Trims_
75 #define _ActivityBot_EE_Trims_ 28
76 #endif
77 
78 #ifndef _ActivityBot_EE_Left_
79 #define _ActivityBot_EE_Left_ 52
80 #endif
81 
82 #ifndef _ActivityBot_EE_Right_
83 #define _ActivityBot_EE_Right_ 1052
84 #endif
85 
86 #ifndef _ActivityBot_EE_End_
87 
91 #define _ActivityBot_EE_End_ 63418 + 2052
92 #endif
93 
94 #ifndef AB_RIGHT
95 #define AB_RIGHT 1
96 #endif
97 
98 #ifndef AB_LEFT
99 #define AB_LEFT -1
100 #endif
101 
102 
103 #ifndef AB_FORWARD
104 #define AB_FORWARD 1
105 #endif
106 
107 #ifndef AB_BACKWARD
108 #define AB_BACKWARD -1
109 #endif
110 
111 #ifndef OFF
112 #define OFF 0
113 #endif
114 
115 #ifndef ON
116 #define ON 1
117 #endif
118 
119 
125 void drive_feedback(int enabled);
126 
127 
134 void drive_trim(int enabled);
135 
136 
157 void drive_trimSet(int direction, int side, int value);
158 
159 
166 void drive_trimDisplay(void);
167 
168 
176 void drive_displayInterpolation(void);
177 
178 
189 void drive_encoderPins(int encPinLeft, int encPinRight);
190 
191 
202 void drive_servoPins(int servoPinLeft, int servoPinRight);
203 
204 
213 void drive_speed(int left, int right);
214 
215 
226 void drive_ramp(int left, int right);
227 
228 
240 void drive_rampStep(int left, int right);
241 
248 void drive_setRampStep(int stepsize);
249 
250 
260 void drive_distance(int left, int right);
261 
262 
267 void drive_close(void);
268 
269 
270 
275 int drive_open();
276 
277 
287 void drive_setMaxSpeed(int speed);
288 
289 
301 void drive_goto(int distLeft, int distRight);
302 
303 
315 void drive_getTicksCalc(int *left, int *right);
316 
317 
327 void drive_getTicksMeasured(int *left, int *right);
328 
329 /*
330  void drive_getSpeedCalc(int *left, int *right);
331  void drive_getSpeedActual(int *left, int *right);
332 */
333 
334 #if defined(__cplusplus)
335 }
336 #endif
337 /* __cplusplus */
338 #endif
339 /* ABDRIVE_H */
340