public class RdGnPiGpioDBlink extends StandardMBean implements PiUtil, RdGnPiGpioDBlinkMbean
A fifth program for Raspberry's GPIO pins Rev. 35 4.04.2021 Copyright (c) 2019 Albrecht Weinert
weinert-automation.de a-weinert.de It uses two/three pins as output assuming two LEDs connected to as H=on Pi 1 / Pi 3 Pin GPIO17/ 17 : red 11 GPIO21/ 27 : green 13 GPIO25 : yellow 22 (since Revision 45) This program forces application singleton and may be used as service. Its functions are the same as rdGnBlinkBlink (even sharing the lockFile) except for using the pigpioD library. Our makefiles define MCU and PLATFORM as make variables and macros. So we could make the GPIO pin and address assignment automatically in the C programmes. (End of original C comment excerpt)
ThePi
object either by a Pi3
(for Pi0, 3 and 4) or
Pi1
interface's inner class.TestOnPi
PiUtil.Impl, PiUtil.LeTick
Modifier and Type | Field and Description |
---|---|
protected String[] |
args |
int |
LEDgnPin |
int |
LEDrdPin
The LEDs to blink.
|
int |
LEDyePin |
PrintWriter |
out |
ERR_CLOSE_WDOG, ERR_NoGPIOLOCK, ERR_NoLOCKFILE, ERR_NoLOCKPROC, ERR_NOT_LOCKED, ERR_OPEN_W_DOG, GPIO_INP, GPIO_OUT, H1, HI, L0, lckPiGpioPth, lckWinGpioPth, LO, PI_PUD_DOWN, PI_PUD_DT, PI_PUD_KP, PI_PUD_OFF, PI_PUD_UP, PIO_ALT0, PIO_ALT1, PIO_ALT2, PIO_ALT3, PIO_ALT4, PIO_ALT5
Modifier | Constructor and Description |
---|---|
protected |
RdGnPiGpioDBlink(String[] args) |
Modifier and Type | Method and Description |
---|---|
void |
doIt()
The application's work.
|
Integer |
getCycCount()
See the number of cycles.
|
Boolean |
getGnLd()
The state of the green LED(s).
|
Integer |
getPiType()
Get the Pi type.
|
Boolean |
getRdLd()
The state of the red LED(s).
|
Boolean |
getYeLd()
The state of the yellow LED(s).
|
static void |
main(String[] args)
The application start.
|
void |
resetCycCount()
Reset the number of cycles counter.
|
void |
stop()
Stop the cycle loop.
|
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, getParameterName, getParameterName, invoke, postDeregister, postRegister, preDeregister, preRegister, setAttribute, setAttributes, setImplementation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
closeLock, closeWatchdog, eightDigitHex, errorText, getLastExcept, getLastExcMess, getOut, openLock, openWatchdog, systemExit, thrDelay, triggerWatchdog, twoDigitDec
public int LEDrdPin
public int LEDyePin
public int LEDgnPin
protected final String[] args
public PrintWriter out
protected RdGnPiGpioDBlink(String[] args) throws NotCompliantMBeanException
NotCompliantMBeanException
public Integer getCycCount()
RdGnPiGpioDBlinkMbean
getCycCount
in interface RdGnPiGpioDBlinkMbean
RdGnPiGpioDBlinkMbean.resetCycCount()
public void resetCycCount()
RdGnPiGpioDBlinkMbean
resetCycCount
in interface RdGnPiGpioDBlinkMbean
RdGnPiGpioDBlinkMbean.getCycCount()
public Boolean getYeLd()
RdGnPiGpioDBlinkMbean
cycle
.getYeLd
in interface RdGnPiGpioDBlinkMbean
public Boolean getGnLd()
RdGnPiGpioDBlinkMbean
cycle
.getGnLd
in interface RdGnPiGpioDBlinkMbean
public Boolean getRdLd()
RdGnPiGpioDBlinkMbean
cycle
.getRdLd
in interface RdGnPiGpioDBlinkMbean
public void stop()
RdGnPiGpioDBlinkMbean
stop
in interface RdGnPiGpioDBlinkMbean
public Integer getPiType()
RdGnPiGpioDBlinkMbean
getPiType
in interface RdGnPiGpioDBlinkMbean
public static void main(String[] args)
doIt()
).
Can be stopped by signal (cntlC), kill command and the like, as well as
by an MBean client, like e.g. JConsole, by operation stop()
.
Run by java RdGnPiGpioDBlink [host [port]] [-option [-option ....-north 29 31 33; -east 36 38 40; -south 11 13 15; -west 16 18 22;
-LEDefault 11 22 13
-pi0 -pi1 -pi3 -pi4
(0, 1, 3 and 4 map to 3, the default)args
- start parameters.public void doIt()