nl.tue.id.creapro.admoveo
Class DigitalSensor

java.lang.Object
  extended by nl.tue.id.creapro.admoveo.Sensor
      extended by nl.tue.id.creapro.admoveo.DigitalSensor
All Implemented Interfaces:
SensorControl, ArduinoListener

public class DigitalSensor
extends Sensor

This class models all digital sensors.

Author:
jhu

Constructor Summary
DigitalSensor(Arduino arduino, int pin)
          Creates an instance of the digital sensor that is connected to a particular pin on the Arduino board.
 
Method Summary
 void disable()
          Disables the sensor.
 void enable()
          Enables the sensor input.
 
Methods inherited from class nl.tue.id.creapro.admoveo.Sensor
addSensorListener, getPin, getSensors, isEnabled, removeSensorListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nl.tue.id.creapro.arduino.ArduinoListener
analogAvailabe, digitalAvailable
 

Constructor Detail

DigitalSensor

public DigitalSensor(Arduino arduino,
                     int pin)
Creates an instance of the digital sensor that is connected to a particular pin on the Arduino board.

Parameters:
arduino - the Arduino board.
pin - the pin to which this sensor is connected.
Method Detail

disable

public void disable()
Description copied from interface: SensorControl
Disables the sensor. No input event will be received from the sensor afterwards, until it is enabled again.

Specified by:
disable in interface SensorControl
Overrides:
disable in class Sensor

enable

public void enable()
Description copied from interface: SensorControl
Enables the sensor input. All the sensors are disabled by default. If input is to be expected from a sensor, it has to be enabled first.

Specified by:
enable in interface SensorControl
Overrides:
enable in class Sensor