public class RdGnPiGpioDBlink extends Object implements PiUtil, RdGnPiGpioDBlinkMBean
A fifth program for Raspberry's GPIO pins Rev. 40 19.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.
ThePi
object either by a Pi3
(for Pi0, 3 and 4) or
by a Pi1
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_ASSIGN_PIN, ERR_CLOSE_WDOG, ERR_NoGPIOLOCK, ERR_NoLOCKFILE, ERR_NoLOCKPROC, ERR_NOT_LOCKED, ERR_OPEN_W_DOG, ERR_PIGPIOD_CON, lckPiGpioPth, lckWinGpioPth
GPIO_INP, GPIO_OUT, GPIOmax, GPIOmin, GPIOutM, H1, HI, L0, LO, PI_PUD_DOWN, PI_PUD_DT, PI_PUD_KP, PI_PUD_OFF, PI_PUD_UP, PIN0, PIN00, PIN01, PIN02, PIN04, PIN06, PIN09, PIN0V, PIN1, PIN14, PIN17, PIN2, PIN20, PIN25, PIN3V, PIN4, PIN5V, PIN6, PIN9, PINig, PINix, PIO_ALT0, PIO_ALT1, PIO_ALT2, PIO_ALT3, PIO_ALT4, PIO_ALT5
AUTHOR, BLANK_STRING, cons, CONSOL_ENCODING, COPYRIGHT, D, D_NaN, D_NegInf, D_PosInf, EMPTY_INT_A, EMPTY_STRING, FILE_ENCODING, FRW_CLLD, FS, FSS, H, hasCons, HOST_IP, HOST_IPv4, HOST_NAME, JAR_ENCODING, JH, JRL, M, NO_BYTES, NO_CLASSES, NO_DOUBLES, NO_OBJECTS, NO_STRINGS, NOT_WINDOWS, ON_PI, ONE_DAY, ONE_HOUR, ONE_LEAP_YEAR, ONE_MINUTE, ONE_SECOND, ONE_WEEK, ONE_YEAR, OS, PROG_NAME, PROG_SHORT, PS, RUNTIME, S, UD, UL, UL_UR_da, UR, WEB_START_VERS
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 |
getLEDgn()
The state of the green LED(s).
|
Boolean |
getLEDrd()
The state of the red LED(s).
|
Boolean |
getLEDye()
The state of the yellow LED(s).
|
Integer |
getPiType()
Get the Pi type.
|
static void |
main(String[] args)
The application start.
|
void |
resetCycCount()
Reset the number of cycles counter.
|
void |
setCycCount(Integer cycCount)
Set the number of cycles.
|
void |
stop()
Stop the cycle loop.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
closeLock, closeWatchdog, eightDigitHex, errorText, getLastExcept, getLastExcMess, getLastLockFN, getOut, getUseLock, openLock, openWatchdog, setUseLock, systemExit, thrDelay, triggerWatchdog, twoDigitDec
isWebStart
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 setCycCount(Integer cycCount)
RdGnPiGpioDBlinkMBean
setCycCount
in interface RdGnPiGpioDBlinkMBean
public void resetCycCount()
RdGnPiGpioDBlinkMBean
resetCycCount
in interface RdGnPiGpioDBlinkMBean
RdGnPiGpioDBlinkMBean.getCycCount()
public Boolean getLEDye()
RdGnPiGpioDBlinkMBean
getLEDye
in interface RdGnPiGpioDBlinkMBean
public Boolean getLEDgn()
RdGnPiGpioDBlinkMBean
getLEDgn
in interface RdGnPiGpioDBlinkMBean
public Boolean getLEDrd()
RdGnPiGpioDBlinkMBean
getLEDrd
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()
.-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()