|
RoboJDETM v2.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ridgesoft.intellibrain.IntelliBrainPinPort
com.ridgesoft.intellibrain.IntelliBrainDigitalIO
com.ridgesoft.intellibrain.IntelliBrainExpDigitalIO
public class IntelliBrainExpDigitalIO
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.
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 |
---|
public void setDirection(boolean isOutput)
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.
setDirection
in class IntelliBrainDigitalIO
isOutput
- true if the port is to be configured as an output, false if it is to be
configured as an inputpublic void setModulatedOutput()
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.
BasicLED
public void setPullUp(boolean pullUp)
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.
setPullUp
in class IntelliBrainPinPort
pullUp
- true does nothing, false throws an exception
UnsupportedOperationException
- if the pullUp is false
|
RoboJDETM v2.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |