PropWare  3.0.0.229
C++ objects and CMake build system for Parallax Propeller
setMaxSpeed.c
1 #include "abdrive.h"
2 
3 volatile int abd_speedLimit[4];
4 
5 void drive_setMaxSpeed(int speed)
6 {
7  abd_speedLimit[ABD_B] = speed;
8 }
9 
10 volatile int abd_speedLimit[4];
11 volatile int abd_gotoSpeedLimit[4];
12 
13 void drive_setMaxVelocity(int forGotoOrSpeed, int ticksPerSec)
14 {
15  int tps = ticksPerSec;
16  switch(forGotoOrSpeed)
17  {
18  case FOR_SPEED:
19  {
20  abd_speedLimit[ABD_L] = tps;
21  abd_speedLimit[ABD_R] = tps;
22  abd_speedLimit[ABD_B] = tps;
23  }
24  case FOR_GOTO:
25  {
26  abd_speedLimit[ABD_L] = tps;
27  abd_speedLimit[ABD_R] = tps;
28  abd_speedLimit[ABD_B] = tps;
29  }
30  }
31 }
32 
33 
34 
35 
drive_setMaxVelocity
void drive_setMaxVelocity(int forGotoOrSpeed, int ticksPerSec)
Set the maximum velocity used by either drive_goto or drive_speed.
Definition: setMaxSpeed.c:13
drive_setMaxSpeed
void drive_setMaxSpeed(int speed)
Modifies the default maximum top speed for use with encoders. The default is 128 ticks/second = 2 rev...
Definition: setMaxSpeed.c:5
FOR_SPEED
#define FOR_SPEED
This constant can be used in place of 0 to tell drive_setAcceleration and drive_setMaxVelocity to set...
Definition: abdrive.h:195
FOR_GOTO
#define FOR_GOTO
This constant can be used in place of 0 to tell drive_setAcceleration and drive_setMaxVelocity to set...
Definition: abdrive.h:184
abdrive.h
This library takes care of encoder monitoring and servo signaling, and provides a simple set of funct...