Page 61
fd [Category: Motors]
Format:
void
fd(
int
m);
Turns motor
m
on full in the forward direction.
Example:
fd(3);
freeze [Category: Motors]
Format:
void
freeze(
int
m);
Freezes motor m (prevents continued motor rotation, in contrast to
off
, which allows the motor
to "coast").
get_analog_pullup [Category: Sensors]
Format:
int
get_analog_pullup(
int
port);
Returns 1 if the port's pull up resistor is set (the default), and 0 otherwise. See also
set_analog_pullup.
get_extra_buttons_visible [Category: Sensors]
Format:
int
get_extra_buttons_visible();
Returns 1 if the X, Y, and Z buttons are visible, 0 if not. See also,
extra_buttons_show
,
extra_buttons_hide.
get_motor_done [Category: Motors]
Format:
int
get_motor_done(
int
m);
Returns whether the motor has finished a move with specified position.
get_motor_position_counter [Category: Motors]
Format:
int
get_motor_position_counter(
int
m);
Returns the current motor position value for motor m (a value which is continually being
updated for each motor using back EMF; a typical discrimination for a given motor is on the
order of 1100 position "ticks" per rotation).
get_pid_gains [Category: Motors]
Format:
int
get_pid_gains(
int
motor,
int
*p,
int
*i,
int
*d,
int
*pd,
int
*id,
int
*dd);
This function is used to obtain the weights of the PID control currently set for the motors. The
p
,
i
and
d
parameters are the numerators for the P, I and D coefficients. The
pd
,
id
and
dd
parameters are their respective denominators. Thus all of the parameters are integers, but the
actual coefficients can be floats. If a motor is jerky, the P and D terms should be reduced in size.
If a motor lags far behind, they should be increased. The default values are set at firmware
install. See also
set_pid_gains.
get_servo_enabled [Category: Servos]
Format:
int
get_servo_enabled(
int
srv);
Returns 1 if the specified servo port is enabled and 0 otherwise. See also
enable_servo
,
disable_servo
.
get_servo_position [Category: Servos]
Format:
int
get_servo_position(
int
srv);
Returns the position value of the servo in port
srv
. The value is in the range 0 to 2047. There
are 4 servo ports (0, 1, 2, 3).
log10 [Category: Math]
Format:
double
log10(
double
num);
Returns the logarithm of num to the base 10.