Page 62
log [Category: Math]
Format:
double
log(
double
num);
Returns the natural logarithm of
num
.
mav [Category: Motors]
Format:
void
mav(
int
m,
int
vel);
This function is the same as
move_at_velocity
.
motor [Category: Motors]
Format:
void
motor(
int
m,
int
p);
Turns on motor
m
at scaled PWM duty cycle percentage
p
. Power levels range from 100 for full
on forward to -100 for full on backward.
move_at_velocity [Category: Motors]
Format:
void
move_at_velocity(
int
m,
int
vel);
Moves motor
m
at velocity vel indefinitely. The velocity range is -1000 to 1000 ticks per
second.
move_relative_position [Category: Motors]
Format:
void
move_relative_position(
int
m,
int
vel,
int
ticks);
Moves motor
m
at velocity
vel
from its current position curr_pos to cu
ticks
. The speed
range is 0 to 1000 ticks per second.
Example:
move_relative_position(1,275,-1100L);
move_to_position [Category: Motors]
Format:
void
move_to_position(
int
m,
int
vel,
int
pos);
Moves motor m at velocity
vel
from its current position curr_pos to
pos
. The speed range is 0
to 1000. Note that if the motor is already at
pos
, the motor doesn't move.
mrp [Category: Motors]
Format:
void
mrp(
int
m,
int
vel,
int
pos);
This function is the same as
move_relative_position
.
mtp [Category: Motors]
Format:
void
mtp(
int
m,
int
vel,
int
pos);
This function is the same as
move_to_position
.
msleep [Category: Time]
Format:
void
msleep(
int
msec);
Waits for an amount of time equal to or greater than
msec
milliseconds.
Example:
msleep(1500);
//wait for 1.5 seconds
off [Category: Motors]
Format:
void
off(
int
m);
Turns off motor
m
.
Example:
off(1);
power_level [Category: Sensor]
Format:
double
power_level();
Returns the current power level in volts.