stamp.core
Class DAC
java.lang.Object
|
+--stamp.core.VirtualPeripheral
|
+--stamp.core.DAC
- public class DAC
- extends VirtualPeripheral
This class provides an interface to the Virtual Peripheral DAC. The
DAC VP implements a one bit digital to analog converter.
Constructor Summary |
DAC(int pin)
Create a new one bit digital to analog converter. |
Method Summary |
void |
start()
Start the DAC running. |
void |
stop()
Stop the DAC from running. |
void |
update(int value)
Update the value being generate on the pin. |
DAC
public DAC(int pin)
- Create a new one bit digital to analog converter.
- Parameters:
pin
- the pin to output the signal on.
update
public void update(int value)
- Update the value being generate on the pin.
- Parameters:
value
- the value to generate on the ouput pin. This value must be between 0 and 255.
start
public void start()
- Start the DAC running. The constructor will start the DAC when it is first
created. If it is later stopped with
stop()
then
start()
will start it again with the same set of parameters.
It is an error to call start if the DAC is already running.
stop
public void stop()
- Stop the DAC from running.