stamp.core
Class Freqout
java.lang.Object
|
+--stamp.core.VirtualPeripheral
|
+--stamp.core.PWM
|
+--stamp.core.Freqout
- public class Freqout
- extends PWM
Frequency generation based on pulse width modulation.
Constructor Summary |
Freqout(int pin)
Creates a Freqout object based on PWM. |
Freqout(int pin,
int frequency)
Creates a Freqout object based on PWM. |
Method Summary |
void |
freqout(int time)
Set output frequency for a fixed amount of time. |
void |
freqout(int frequency,
int time)
Set output frequency for a fixed amount of time. |
void |
setFrequency(int frequency)
Set output frequency. |
Freqout
public Freqout(int pin)
- Creates a Freqout object based on PWM. Does not start running.
- Parameters:
pin
- the pin to generate the PWM signal on.
Freqout
public Freqout(int pin,
int frequency)
- Creates a Freqout object based on PWM. Does not start running.
- Parameters:
pin
- the pin to generate the PWM signal on.frequency
- frequency in hertz/10 (1 - 12k)
setFrequency
public void setFrequency(int frequency)
- Set output frequency. Accurate only to 8.68us timebase.
- Parameters:
frequency
- frequency in hertz/10 (1 - 12k)
freqout
public void freqout(int frequency,
int time)
- Set output frequency for a fixed amount of time.
It starts and stops the base PWM.
- Parameters:
frequency
- frequency in hertz/10 (1 - 12k)time
- amount of time in CPU.delay() units
freqout
public void freqout(int time)
- Set output frequency for a fixed amount of time.
It start()s and stop()s the base PWM.
- Parameters:
time
- amount of time in CPU.delay() units