orc
Class DigitalPWM
java.lang.Object
orc.DigitalPWM
public class DigitalPWM
- extends java.lang.Object
Allows low-speed PWM (on the FAST digital I/O pins), meaning rates
up to 1khz. Timing will not be terribly accurate, since this PWM is
generated in software but should be good to a few percent.
Constructor Summary |
DigitalPWM(Orc orc,
int port)
Initialize PWM output. |
Method Summary |
static void |
main(java.lang.String[] args)
|
void |
setPWM(int period_usec,
double dutyCycle)
Note that small values may have a significant effect on the
CPU utilization of the uorc. |
void |
setValue(boolean v)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DigitalPWM
public DigitalPWM(Orc orc,
int port)
- Initialize PWM output.
- Parameters:
port
- Digital I/O port number on the FAST inputs [0,7]
setPWM
public void setPWM(int period_usec,
double dutyCycle)
- Note that small values may have a significant effect on the
CPU utilization of the uorc. Recommended to keep frequency
under 100Hz (period over 10000 usec).
- Parameters:
period_usec
- [1000, 1000000]dutyCycle
- [0, 1]
setValue
public void setValue(boolean v)
main
public static void main(java.lang.String[] args)