Skip navigation links
de.weAut

Class TestOnPi

    • Field Detail

      • ledRDpin

        public int ledRDpin
        The LEDs to blink.

        The default pins for rd/ye/gn are 11, 22, and 13.
        This is the traditional 2017 experimental setup. With a piTraffic (cross roads) head ledGNpin would be south yellow and ledYEpin west green.
      • ledYEpin

        public int ledYEpin
        The LEDs to blink.

        The default pins for rd/ye/gn are 11, 22, and 13.
        This is the traditional 2017 experimental setup. With a piTraffic (cross roads) head ledGNpin would be south yellow and ledYEpin west green.
      • ledGNpin

        public int ledGNpin
        The LEDs to blink.

        The default pins for rd/ye/gn are 11, 22, and 13.
        This is the traditional 2017 experimental setup. With a piTraffic (cross roads) head ledGNpin would be south yellow and ledYEpin west green.
      • buttPin

        public int buttPin
        The input or button.

        This is a general purpose input (to be tested).
        On a trafficPi shield e.g. the pin for a lo-active button (needs a pull up) is 7. Hence, as mnemonic, the names for options, setters and getters refer to / abbreviate button.

        default: PINig ignore, no operation resp. 0
      • buttGpio

        public int buttGpio
        The input or button.

        This is a general purpose input (to be tested).
        On a trafficPi shield e.g. the pin for a lo-active button (needs a pull up) is 7. Hence, as mnemonic, the names for options, setters and getters refer to / abbreviate button.

        default: PINig ignore, no operation resp. 0
      • gpio

        public int gpio
        The GPIO respectively pin to use for (single / non LED) operations.

        This is general purpose output to be tested.
        On a trafficPi shield, e.g., besides the 12 LEDs, this could be the buzzer. It is controlled (hi-active) by pin 12. Hence, as mnemonic, the names for options, setters and getters partly refer to / abbreviate buzzer.
        default: PINig ignore, no operation resp. 0
      • pin

        public int pin
        The GPIO respectively pin to use for (single / non LED) operations.

        This is general purpose output to be tested.
        On a trafficPi shield, e.g., besides the 12 LEDs, this could be the buzzer. It is controlled (hi-active) by pin 12. Hence, as mnemonic, the names for options, setters and getters partly refer to / abbreviate buzzer.
        default: PINig ignore, no operation resp. 0
    • Constructor Detail

      • TestOnPi

        public TestOnPi()
    • Method Detail

      • parsePartial

        public final boolean parsePartial()
        Description copied from class: App
        Partial evaluation of start parameters by Prop.

        This method has to return true if the Prop object shall evaluate and check the start parameters (see App.args) only partially. For the meaning of "partial evaluation" please see Prop#parse(String[],CharSequence,boolean) Prop.parse(String[], CharSequence, boolean).

        As the partial evaluation of start arguments by Prop is a fixed property of an application classes extending App must override this method finally this methods default behaviour is not wanted.
        Overrides:
        parsePartial in class App
        Returns:
        false except when made by the make'n go constructor App.App(String[])
      • getCycCount

        public Integer getCycCount()
        Description copied from interface: TestOnPiMBean
        See the number of cycles.

        As the duration of one cycle is 600ms it would take more than 40 years to overflow to negative.
        Note: Java has no unsigned number type. int is int32_t there is no uint32_t.
        Specified by:
        getCycCount in interface TestOnPiMBean
        Returns:
        the loop / cycle or delay count
        See Also:
        TestOnPiMBean.resetCycCount()
      • resetCycCount

        public Integer resetCycCount()
        Description copied from interface: TestOnPiMBean
        Reset the number of cycles counter.

        If you don't want to wait almost 82 years to see low positive numbers again, you may reset the counter (via JConsole e.g.).
        Specified by:
        resetCycCount in interface TestOnPiMBean
        Returns:
        the last value before this reset
        See Also:
        TestOnPiMBean.getCycCount()
      • getLEDye

        public Boolean getLEDye()
        Description copied from interface: TestOnPiMBean
        The state of the yellow LED(s).

        The yellow LED(s) are inverted only once in a cycle.
        Specified by:
        getLEDye in interface TestOnPiMBean
        Returns:
        true when ON
      • getLEDgn

        public Boolean getLEDgn()
        Description copied from interface: TestOnPiMBean
        The state of the green LED(s).

        The yellow LED(s) are inverted twice in a cycle.
        Specified by:
        getLEDgn in interface TestOnPiMBean
        Returns:
        true when ON
      • getLEDrd

        public Boolean getLEDrd()
        Description copied from interface: TestOnPiMBean
        The state of the red LED(s).

        The red LED(s) are inverted twice in a cycle.
        Specified by:
        getLEDrd in interface TestOnPiMBean
        Returns:
        true when ON
      • getLeBut

        public Boolean getLeBut()
        Description copied from interface: TestOnPiMBean
        The state of the button.

        The button is low active. Hence, false means pressed.
        Specified by:
        getLeBut in interface TestOnPiMBean
        Returns:
        true when open, released
      • setStepDelay

        public final void setStepDelay(Integer delay)
        Description copied from interface: TestOnPiMBean
        Set delay / ms between two operations.
        Specified by:
        setStepDelay in interface TestOnPiMBean
        Parameters:
        delay - 2 .. 29999 ms; default 10 ms
      • setStepVal

        public final void setStepVal(Integer stepVal)
        Description copied from interface: TestOnPiMBean
        Set step between two PMW or servo values.
        Specified by:
        setStepVal in interface TestOnPiMBean
        Parameters:
        stepVal - the value will be adjusted at use if not fitting
      • getStepVal

        public final Integer getStepVal()
        Description copied from interface: TestOnPiMBean
        Get step between two PMW or servo values.
        Specified by:
        getStepVal in interface TestOnPiMBean
        Returns:
        the actual value; default 10
      • setVal

        public void setVal(Integer val)
        Description copied from interface: TestOnPiMBean
        Set PMW or servo current value.
        Specified by:
        setVal in interface TestOnPiMBean
        Parameters:
        val - the value will be adjusted at use if not fitting
      • getVal

        public Integer getVal()
        Description copied from interface: TestOnPiMBean
        Get PMW or servo current value.
        Specified by:
        getVal in interface TestOnPiMBean
        Returns:
        the actual value; default 100
      • setValUp

        public void setValUp(Integer valUp)
        Description copied from interface: TestOnPiMBean
        Set PMW or servo value upper limit.
        Specified by:
        setValUp in interface TestOnPiMBean
        Parameters:
        valUp - the limit will be adjusted at use if not fitting
      • getValUp

        public Integer getValUp()
        Description copied from interface: TestOnPiMBean
        Get PMW or servo value upper limit.
        Specified by:
        getValUp in interface TestOnPiMBean
        Returns:
        the actual value; default 255
      • setValLo

        public void setValLo(Integer valLo)
        Description copied from interface: TestOnPiMBean
        Set PMW or servo value lower limit.
        Specified by:
        setValLo in interface TestOnPiMBean
        Parameters:
        valLo - the limit will be adjusted at use if not fitting
      • getValLo

        public Integer getValLo()
        Description copied from interface: TestOnPiMBean
        Get PMW or servo value lower limit.
        Specified by:
        getValLo in interface TestOnPiMBean
        Returns:
        the actual value; default 0
      • main

        public static void main(String[] args)
        The application start.

        Will blink with three LEDs in an endless loop (in 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 App.stop(). Run by java TestOnPi [host [port]] [-option [-option ....
        LEDs rd,ye,gn Options are: -north 29 31 33; -east 36 38 40; -south 11 13 15; -west 16 18 22;
        -LEDefault 11 22 13
        Pi type options are: -pi0 -pi1 -pi3 -pi4 (0, 1, 3 and 4 map to 3, the default)
        Parameters:
        args - start parameters.