Class and Functions


To use this extension board, use the ExpansionDCMotor class of the PHPoC Expansion library.

Member Functions

Available member functions of the ExpansionDCMotor class are as follows:

Member Function Description
int getPID(void) get the product's ID
char *getName(void) get the product's name
ExpansionDCMotor(int sid, int port) create an instance of a motor port
setPolarity(int pol) set a PWM polarity
setDirection(int dir) set a direction of rotation
setPeriod(long period) set a PWM period
setWidth(long width) set a HIGH duration (a duty cycle)
setDecay(int decay) set decay mode
setEncoderPolarity(int pol) set a count direction of encoder
setEncoderPosition(long pos) set a counter value of encoder
setEncoderPSR(int psr) set a sampling count of encoder
getEncoderPosition(void) get a counter value of encoder
getEncoderPeriod(void) get a period of encoder output
setFilterFrequency(long freq) set a cut-off frequency of LPF
setFilterPNC(int pnc) set a noise counter of LPF
getFilterPNC(void) get a noise counter of LPF