B4J Programming Press on the image to return to the main documentation page.

jPi4J

List of types:

GpioController
GpioPinAnalogInput
GpioPinDigitalInput
GpioPinDigitalOutput
LED
PiFace
Relay
Switch

GpioController


Events:

None

Members:


  Initialize

  InitializePiFace (SpiAddress As Byte, SpiChannel As Int)

  IsInitialized As Boolean

  Shutdown

Members description:

Initialize
Initializes the controller.
InitializePiFace (SpiAddress As Byte, SpiChannel As Int)
Initializes the PiFace controller.
Example:
controller.InitializePiFace(0x40, 0)
IsInitialized As Boolean
Shutdown
Shuts down the controller and removes all listeners.

GpioPinAnalogInput


Events:

None

Members:


  Initialize (PinNumber As Int)

  IsInitialized As Boolean

  Value As Double [read only]

Members description:

Initialize (PinNumber As Int)
IsInitialized As Boolean
Value As Double [read only]

GpioPinDigitalInput


Events:

StateChange(State As Boolean)

Members:


  ChangeToOutput As GpioPinDigitalOutput

  Initialize (EventName As String, PinNumber As Int)

  IsInitialized As Boolean

  Name As String

  SetPinPullResistance (Resistance As com.pi4j.io.gpio.PinPullResistance)

  SetShutdownOptions (Unexport As Boolean, State As Boolean, Resistance As com.pi4j.io.gpio.PinPullResistance)

  State As Boolean [read only]

Members description:

ChangeToOutput As GpioPinDigitalOutput
Changes the pin mode to output and returns a new GpioPinDigitalOutput object.
Initialize (EventName As String, PinNumber As Int)
Initializes the pin and provisions it to be a digital input pin.
EventName - Sets the sub that will handle the StateChange event.
PinNumber - 1-29.
IsInitialized As Boolean
Name As String
Gets or sets the pin's friendly name.
SetPinPullResistance (Resistance As com.pi4j.io.gpio.PinPullResistance)
Sets the pin pull resistance.
Resistance - One of the following string values: OFF, PULL_UP, PULL_DOWN.
SetShutdownOptions (Unexport As Boolean, State As Boolean, Resistance As com.pi4j.io.gpio.PinPullResistance)
Configures the settings which will be set when the controller is shutdown.
Resistance should be one of the following values: OFF, PULL_UP, PULL_DOWN.
State As Boolean [read only]
Gets the current state.

GpioPinDigitalOutput


Events:

None

Members:


  Blink (Delay As Long)

  ChangeToInput As GpioPinDigitalInput

  Initialize (PinNumber As Int, State As Boolean)

  IsInitialized As Boolean

  Name As String

  Pulse (Delay As Long)

  SetPinPullResistance (Resistance As com.pi4j.io.gpio.PinPullResistance)

  SetShutdownOptions (Unexport As Boolean, State As Boolean, Resistance As com.pi4j.io.gpio.PinPullResistance)

  State As Boolean

Members description:

Blink (Delay As Long)
The pin state will be set to low for the specified interval (measured in milliseconds).
ChangeToInput As GpioPinDigitalInput
Changes the pin mode to input and returns a new GpioPinDigitalInput object.
Note that for the StateChange event to work the pin must have been first initialized as an input pin.
Initialize (PinNumber As Int, State As Boolean)
Initializes the pin and provision it to a digital output pin.
PinNumber - 1-29.
State - True for high, False for low.
IsInitialized As Boolean
Name As String
Gets or sets the pin's friendly name.
Pulse (Delay As Long)
The pin state will be set to high for the specified interval (measured in milliseconds).
SetPinPullResistance (Resistance As com.pi4j.io.gpio.PinPullResistance)
Sets the pin pull resistance.
Resistance - One of the following string values: OFF, PULL_UP, PULL_DOWN.
SetShutdownOptions (Unexport As Boolean, State As Boolean, Resistance As com.pi4j.io.gpio.PinPullResistance)
Configures the settings which will be set when the controller is shutdown.
Resistance should be one of the following values: OFF, PULL_UP, PULL_DOWN.
State As Boolean
Gets or sets the pin state.

LED


Events:

None

Members:


  IsInitialized As Boolean

  State As Boolean

Members description:

IsInitialized As Boolean
State As Boolean
Gets or sets the LED state. True = On, False = Off.

PiFace


Events:

None

Members:


  GetLED (Index As Int) As LED

  GetRelay (Index As Int) As Relay

  GetSwitch (Index As Int) As Switch

  Initialize (SpiAddress As Byte, SpiChannel As Int)

  IsInitialized As Boolean

Members description:

GetLED (Index As Int) As LED
Gets a reference to a LED. Index should be between 0 to 7.
GetRelay (Index As Int) As Relay
Gets a reference to a Relay. Index should be between 0 to 1.
GetSwitch (Index As Int) As Switch
Gets a reference to a Switch. Index should be between 0 to 3.
Initialize (SpiAddress As Byte, SpiChannel As Int)
Initializes the PiFace object.
Example:
pf.Initialize(0x40, 0)
IsInitialized As Boolean

Relay


Events:

None

Members:


  IsInitialized As Boolean

  State As Boolean

Members description:

IsInitialized As Boolean
State As Boolean
Gets or sets the relay state. True = Closed, False = Open.

Switch


Events:

StateChange(State As Boolean)

Members:


  AddListener (EventName As String)

  IsInitialized As Boolean

  State As Boolean [read only]

Members description:

AddListener (EventName As String)
Adds an event listener.
IsInitialized As Boolean
State As Boolean [read only]
Gets the switch state. True = On, False = Off.
Top