B4J Question How to use 2 PiFace2 with Raspberry

Jaume Guillem

Member
Licensed User
Longtime User
I am trying an application where two PiFace2 cards are needed.
The pins that assign the number are clear on the card, but I can't get the second one to work.

With one card I use:

B4X:
Dim controller1 As GpioController
Dim input0 As GpioPinDigitalInput
......
Dim Output0 As GpioPinDigitalOutput
......

controller1.InitializePiFace (0x40,0)
input0.Initialize ("sw0", 0)
.....
Output0.Initialize (0, False)
.....

This works perfectly, but if I try to assign more inputs or outputs

input8.Initialize ("sw8", 8)
or
Output8.Initialize (8, False)

they do not accept it.

Also with a single card, but assigning bus 1 (to test) does not work either
B4X:
controller1.InitializePiFace (0x40,1)
( having the jumpers correctly to bus 1 on the card).

It seems that only ONE card can be used AND on bus 0.

Anyone know how to work with both cards?

Thanks
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…