|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmaslab.orc.Motor
public class Motor
Orc wrapper for a motor.
| Constructor Summary | |
|---|---|
Motor(Orc orc,
int motorport,
boolean motorflip)
Create a new Motor wrapper. |
|
Motor(Orc orc,
int motorport,
boolean motorflip,
int quadphaseport,
boolean quadflip)
Create a new Motor wrapper, assuming normal quadrature phase decoding. |
|
Motor(Orc orc,
int motorport,
boolean motorflip,
int quadphaseport,
boolean quadflip,
Orc.PinMode m)
Create a new Motor wrapper, using the specified wheel position decoding mode.. |
|
| Method Summary | |
|---|---|
double |
current()
Get the motor current in amps. |
int |
encoder()
Returns the number of counts since the last call to this function. |
long |
encoderAbsolute()
Return the total number of encoder counts since the app was started. |
int |
get()
Get the motor's (actual) PWM. |
int |
getGoal()
Get the requested PWM, as last set. |
static void |
main(java.lang.String[] args)
A very simple little motor test program. |
void |
set(int pwm)
Set the motor's PWM. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Motor(Orc orc,
int motorport,
boolean motorflip)
orc - The orc object.motorport - The port that the motor is connectoed to [0,3]motorflip - Set to true if the motor runs "backwards'
public Motor(Orc orc,
int motorport,
boolean motorflip,
int quadphaseport,
boolean quadflip)
orc - The orc object.motorport - The port that the motor is connectoed to [0,3]motorflip - Set to true to reverse the motor direction.quadphaseport - The port that the quadphase is connected to (16 or 18)quadflip - Set to true to reverse the quadphase direction.
public Motor(Orc orc,
int motorport,
boolean motorflip,
int quadphaseport,
boolean quadflip,
Orc.PinMode m)
orc - The orc object.motorport - The port that the motor is connectoed to [0,3]motorflip - Set to true to reverse the motor direction.quadphaseport - The port that the quadphase is connected to (16 or 18)quadflip - Set to true to reverse the quadphase direction.m - Set the quadphase to the particular type (fast, normal, mono)| Method Detail |
|---|
public void set(int pwm)
pwm - The direction/strength to drive, [-255, 255].public int get()
public int getGoal()
public double current()
public int encoder()
public long encoderAbsolute()
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||