stamp.core
Class ADC

java.lang.Object
  |
  +--stamp.core.VirtualPeripheral
        |
        +--stamp.core.ADC

public class ADC
extends VirtualPeripheral

This class provides an interface to the Virtual Peripheral ADC.


Constructor Summary
ADC(int inPin, int outPin)
          Create a sigma-delta analog to digital converter virtual peripheral and start it running.
 
Method Summary
 void start()
          Start the ADC running.
 void stop()
          Stop the ADC from running.
 int value()
          Read the value currently being read by the ADC.
 
Methods inherited from class java.lang.Object
equals
 

Constructor Detail

ADC

public ADC(int inPin,
           int outPin)
Create a sigma-delta analog to digital converter virtual peripheral and start it running.
Parameters:
inPin - the pin to be used as an input by the converter.
outPin - the pin to be used as an output by the converter.
Method Detail

value

public int value()
Read the value currently being read by the ADC.
Returns:
value being read by ADC.

start

public void start()
Start the ADC running. The constructor will start the ADC 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 ADC is already running.


stop

public void stop()
Stop the ADC from running.