public abstract class AbstractDigitalOutput extends AbstractPinFeature implements DigitalOutput
| Constructor and Description |
|---|
AbstractDigitalOutput(Pin pin) |
| Modifier and Type | Method and Description |
|---|---|
void |
applySignal(Signal signal)
Writes a state to the pin.
|
protected abstract void |
applySignalImpl(Signal signal) |
void |
awaitBlinkingStopped()
Halts the current thread until the blinking on the output
has stopped.
|
void |
blinkTimes(int periodMilliseconds,
int times)
This method is used to let the input blink a number of times.
|
Signal |
getAppliedSignal()
Gets the signal that is currently applied to the pin.
|
String |
getName() |
void |
high()
Applies a high level signal to the pin.
|
boolean |
isBlinking()
Checks if this output is currently blinking.
|
boolean |
isHigh()
Queries if the signal on the pin
is currently high.
|
boolean |
isLow()
Queries if the signal on the pin
is currently low.
|
void |
low()
Applies a low level signal to the pin.
|
void |
startBlinking(int periodMilliseconds)
This method is used to let the pin blink indefinitely.
|
void |
startBlinking(int periodMilliseconds,
int durationMilliseconds)
This method is used to let the pin blink for a specified
duration.
|
void |
stopBlinking()
Stops any blinking process that is currently in progress on
this output.
|
void |
toggle()
Toggles the current signal on the pin.
|
void |
write(Signal signal)
Writes a state to the pin.
|
activate, blockPin, getPin, isActivatedFeature, isBlocking, isSetup, isTorndownOnShutdown, setTeardownOnShutdown, setup, setupImpl, teardown, teardownImpl, toString, unblockPinclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitactivate, blockPin, getPin, isActivatedFeature, isBlocking, isSetup, isTorndownOnShutdown, setTeardownOnShutdown, setup, teardown, unblockPinpublic AbstractDigitalOutput(Pin pin)
public String getName()
getName in interface PinFeaturepublic void write(Signal signal)
DigitalOutputwrite in interface DigitalOutputsignal - the signalpublic void applySignal(Signal signal)
DigitalOutputapplySignal in interface DigitalOutputsignal - the signalpublic void high()
DigitalOutputhigh in interface DigitalOutputpublic void low()
DigitalOutputlow in interface DigitalOutputpublic boolean isHigh()
DigitalOutputisHigh in interface DigitalOutputpublic boolean isLow()
DigitalOutputisLow in interface DigitalOutputpublic void toggle()
DigitalOutputtoggle in interface DigitalOutputpublic Signal getAppliedSignal()
DigitalOutputgetAppliedSignal in interface DigitalOutputpublic void startBlinking(int periodMilliseconds)
DigitalOutputstopBlinking() method.
You can specify the duration of a blinking period.
A blinking period is the full cycle of a state transition
and includes the the high phase as well as the low phase.
Both phases have the same duration.startBlinking in interface DigitalOutputperiodMilliseconds - the duration of one full
blinking period in millisecondspublic void startBlinking(int periodMilliseconds,
int durationMilliseconds)
DigitalOutputstopBlinking()
method. You can specify the duration of a blinking period.
A blinking period is the full cycle of a state transition
and includes the the high phase as well as the low phase.
Both phases have the same duration.
Also, you can specify the duration of the whole blinking process,
e.g. specify to let the output blink for 3000 milliseconds.startBlinking in interface DigitalOutputperiodMilliseconds - the duration of one full
blinking period in millisecondsdurationMilliseconds - the duration of the whole blinking
process in milliseconds. A value of 0
let's it blink indefinitely.public void stopBlinking()
DigitalOutputstopBlinking in interface DigitalOutputpublic void blinkTimes(int periodMilliseconds,
int times)
DigitalOutputblinkTimes in interface DigitalOutputperiodMilliseconds - the duration of one full
blinking period in millisecondstimes - the amount of times the output should blinkpublic boolean isBlinking()
DigitalOutputisBlinking in interface DigitalOutputpublic void awaitBlinkingStopped()
DigitalOutputawaitBlinkingStopped in interface DigitalOutputprotected abstract void applySignalImpl(Signal signal)
Copyright © 2015 silverspoon.io. All rights reserved.