39 #if defined(__cplusplus) 44 #include "simpletools.h" 48 #ifndef DOXYGEN_SHOULD_SKIP_THIS 50 #ifndef ABD360_GOTO_BUSY 51 #define ABD360_GOTO_BUSY 1 54 #ifndef ABD360_GOTO_CLEAR 55 #define ABD360_GOTO_CLEAR 0 58 #ifndef ABD360_GOTO_BLOCK 59 #define ABD360_GOTO_BLOCK 0 62 #ifndef ABD360_GOTO_SET_FORGET 63 #define ABD360_GOTO_SET_FORGET 1 67 #define AB360_NEITHER 0 106 #ifndef ABD60_PIN_CTRL_L 107 #define ABD60_PIN_CTRL_L 12 110 #ifndef ABD60_PIN_FB_L 111 #define ABD60_PIN_FB_L 14 114 #ifndef ABD360_PIN_CTRL_R 115 #define ABD360_PIN_CTRL_R 13 118 #ifndef ABD360_PIN_FB_R 119 #define ABD360_PIN_FB_R 15 122 #ifndef ABD360_UNITS_REV 123 #define ABD360_UNITS_REV 64 126 #ifndef ABD_RAMP_STEP 127 #define ABD_RAMP_STEP 12 130 #ifndef ABD_SPEED_LIMIT 131 #define ABD_SPEED_LIMIT 128 134 #ifndef ABD_GOTO_SPEED_LIMIT 135 #define ABD_GOTO_SPEED_LIMIT 64 138 #ifndef ABD_GOTO_RAMP_STEP 139 #define ABD_GOTO_RAMP_STEP 8 146 #ifndef _AB360_EE_Start_ 147 #define _AB360_EE_Start_ 63418 150 #ifndef _AB360_EE_Pins_ 151 #define _AB360_EE_Pins_ 12 159 #ifndef _AB360_EE_mVccwL_ 160 #define _AB360_EE_mVccwL_ 28 163 #ifndef _AB360_EE_bVccwL_ 164 #define _AB360_EE_bVccwL_ 32 167 #ifndef _AB360_EE_mVcwL_ 168 #define _AB360_EE_mVcwL_ 36 171 #ifndef _AB360_EE_bVcwL_ 172 #define _AB360_EE_bVcwL_ 40 175 #ifndef _AB360_EE_mVccwR_ 176 #define _AB360_EE_mVccwR_ 44 179 #ifndef _AB360_EE_bVccwR_ 180 #define _AB360_EE_bVccwR_ 48 183 #ifndef _AB360_EE_mVcwR_ 184 #define _AB360_EE_mVcwR_ 52 187 #ifndef _AB360_EE_bVcwR_ 188 #define _AB360_EE_bVcwR_ 56 191 #ifndef _AB360_EE_End_ 192 #define _AB360_EE_End_ _AB360_EE_Start_ + 60 196 extern volatile int abd360_initialized;
198 extern volatile int abd360_unitsPerRev;
200 extern volatile int abd360_pinCtrlLeft;
201 extern volatile int abd360_pinCtrlRight;
202 extern volatile int abd360_pinFbLeft;
203 extern volatile int abd360_pinFbRight;
205 extern volatile int abd360_speedLimit;
206 extern volatile int abd360_rampStep;
207 extern volatile int abd360_setRampStep;
208 extern volatile int abd360_speedLimitGoto;
209 extern volatile int abd360_rampStepGoto;
211 extern volatile int abd360_gotoMode;
214 void drive_init(
void);
215 void drive360_ticksPerRev(
int units);
219 #endif // DOXYGEN_SHOULD_SKIP_THIS 460 #if defined(__cplusplus) void drive_encoderPins(int encPinLeft, int encPinRight)
Sets feedback pins to values other than the default P14 for left and P15 for right. Stores values in EEPROM, so you only need to call this function at the start of one program. Programs that are run after that will get the modified port numbers from EEPROM.
Definition: drive_encoderPins.c:28
void drive_getTicks(int *left, int *right)
Get the measured number of ticks each servo has traveled since the program started running...
Definition: drive_getTicks.c:17
void drive_rampStep(int left, int right)
This function allows your code to ask for a speed repeatedly in a loop, but each time your code asks ...
Definition: drive_rampStep.c:17
void drive_ramp(int left, int right)
This function ramps up to a given speed and blocks execution until the speed is reached. In practice, a call to drive_speed followed by a pause to reach the desired speed will have the same effect but does not have practical applications.
Definition: drive_ramp.c:17
void drive_setAcceleration(int forGotoOrSpeed, int ticksPerSecSq)
Set the acceleration used by either drive_goto or drive_speed.
Definition: drive_setAcceleration.c:17
void drive_goto(int distLeft, int distRight)
Make the wheels travel a certain distance, measured in ticks. Each "tick" is a 64th of a wheel turn...
Definition: drive_goto.c:17
int drive_gotoStatus(int side)
After using drive_gotoMode(0) to cause the drive_goto function to not wait until the maneuver is done...
Definition: drive_gotoStatus.c:18
void drive_setMaxVelocity(int forGotoOrSpeed, int ticksPerSec)
Set the maximum velocity used by either drive_goto or drive_speed. The defaults are 128 ticks per se...
Definition: drive_setMaxVelocity.c:17
void drive_getTicksCalc(int *left, int *right)
Get the calculated number of 1/64th wheel revolution ticks the abdrive360 control system thinks each ...
Definition: drive_getTicksCalc.c:17
void drive_gotoMode(int mode)
Set the mode of the drive_goto call to blocking (default) or interruptible. For calls in interruptibl...
Definition: drive_gotoMode.c:19
void drive_suppress_eeprom(int state)
Enables or disables ignore calibration settings stored in EEPROM. This feature allows an ActivityBot...
Definition: abdrive360.c:40
void drive_speed(int left, int right)
Set wheel speeds in "ticks" per second. A tick is 1/64th of a revolution, and makes an ActivityBot 36...
Definition: drive_speed.c:17
void drive_setMaxSpeed(int speed)
Modifies the default maximum top speed for Feedback 360 high speed servos. For calls to drive_speed...
Definition: drive_setMaxSpeed.c:17
void drive_setRampStep(int stepsize)
Overrides the default 12 ticks/second per 50th of a second for ramping. Note: drive_setAcceleration i...
Definition: drive_setRampStep.c:17
void drive_servoPins(int controlPinLeft, int controlPinRight)
Sets servo pins to values other than the default P12 for the left servo and P13 for right servo...
Definition: drive_servoPins.c:31
void drive_feedback(int enabled)
Enables or disables encoder feedback for speed control.
Definition: drive_feedback.c:17