RoboJDETM v2.0

com.ridgesoft.intellibrain
Class IntelliBrainExpDigitalIO

java.lang.Object
  extended by com.ridgesoft.intellibrain.IntelliBrainPinPort
      extended by com.ridgesoft.intellibrain.IntelliBrainDigitalIO
          extended by com.ridgesoft.intellibrain.IntelliBrainExpDigitalIO
All Implemented Interfaces:
DigitalInput, DigitalOutput, PulseInput, PulseOutput

public class IntelliBrainExpDigitalIO
extends IntelliBrainDigitalIO

Class representing a single digital input/output pin on the expansion board.

The expansion board digital ports may be used as digital inputs or digital outputs.

IntelliBrain expansion boards digital ports do not support pulse input measurement.

Pulse output is supported on any digital port, even when configured as an input.

Digital ports 17 and 18 support modulated infrared LEDs. See the setModulatedOutput method.

By default the port is configured as a digital input.

See Also:
IntelliBrain.getDigitalIO(int)

Method Summary
 void setDirection(boolean isOutput)
          Configures the port as an input or output.
 void setModulatedOutput()
          Sets the port to be a 38 kHz modulated output.
 void setPullUp(boolean pullUp)
          Unsupported on IntelliBrain exapansion board digital ports.
 
Methods inherited from class com.ridgesoft.intellibrain.IntelliBrainDigitalIO
clear, enablePulseMeasurement, isSet, pulse, pulse, readEdgeCount, readPulseDuration, readPulseDuration, set, toggle, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait
 

Method Detail

setDirection

public void setDirection(boolean isOutput)
Configures the port as an input or output.

When configuring a port to be an input, its value is cleared.

When configuring a port to be an output, the pull-up resistor is disabled.

By default digital ports are configured as inputs.

Overrides:
setDirection in class IntelliBrainDigitalIO
Parameters:
isOutput - true if the port is to be configured as an output, false if it is to be configured as an input

setModulatedOutput

public void setModulatedOutput()
Sets the port to be a 38 kHz modulated output.

This enables the port to control an infrared LED with 38 kHz modulation, enabling the LED to send signals that can be detected by the infrared receiver on the IntelliBrain main board.

When configured as a modulated output, the 38 kHz signal is disabled when the output is set and enabled when the output is cleared. This method intializes the output to be set, disabling the modulation signal.

Using the setDirection method reverts the port a normal digital input or output.

When attaching an LED to the port, its anode (longer lead) should be connected to the power pin. The LED's cathode (shorter lead) should be connected to a current limiting resistor (~220 ohm) which connects to the signal pin.

This feature is supported on digital ports 17 and 18.

See Also:
BasicLED

setPullUp

public void setPullUp(boolean pullUp)
Unsupported on IntelliBrain exapansion board digital ports.

The IntelliBrain expansion board digital ports have hard-wired pull-up resistors. Therefore, this method throws an exception if an attempt is made to disable the pull-up resistor.

Overrides:
setPullUp in class IntelliBrainPinPort
Parameters:
pullUp - true does nothing, false throws an exception
Throws:
UnsupportedOperationException - if the pullUp is false

RoboJDETM v2.0

Copyright (c) 2003-2009 RidgeSoft, LLC. All rights reserved.
www.ridgesoft.com