element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Multi PiFace Card... Help!
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 6 replies
  • Subscribers 706 subscribers
  • Views 1126 views
  • Users 0 members are here
  • python;
  • commands;guidebook;toggle;read;write;pirack;pirack&piface
  • piface;
  • raspberry_pi
  • driver;
  • c;
Related

Multi PiFace Card... Help!

e14 Contributor
e14 Contributor over 12 years ago

Hello, and Help!

 

I bought one RaspRack and 4 Piface cards. The PiRack is made to add 4 Piface cards (they are addressable hardware 0-3 by jumpers).
No guidbook or example in C or Python to comment on the software part!
So, I installed both cards, the first address in 0, the second address 1 etc. ... to 3.

I swapped the bus SPI CE for each card, ...

The hardware part is ok!

 

Questions:

- How to stick a relay on the fourth Piface card?
- How to read the inputs in the second Piface card?
- How to toggle relay on on the third Piface card?
- Where can I find an basic commands list and the existing drivers?

 

A simple example in Python or C would be welcome for all.

 

the only examples I've found, are intended just the map 0.

Ditto for the interface Piface-emulator, it just recognize the card 0.

 

Thank you in advance for your answer.
Sincerely Joel.

  • Sign in to reply
  • Cancel
Parents
  • e14 Contributor
    e14 Contributor over 12 years ago

    With the latest version of the software you can specify the `hardware_addr` of the board as the first argument to PiFaceDigital. There is documentation for it here: http://piface.github.io/pifacedigitalio/reference.html#pifacedigitalio.core.PiFaceDigital


    This probably should be mentioned in the examples page: http://piface.github.io/pifacedigitalio/example.html
    I'll put this on my todo list.

     

    To install the latest version of the software you would usually run:


        sudo apt-get update && sudo apt-get upgrade
        sudo apt-get install python3-pifacedigitalio


    However, the Raspbian package maintainers have not yet updated the piface packages so you will have to install them manually.


    To do so, download the latest pifacedigitalio and pifacecommon from:
       

        https://github.com/piface/pifacecommon/releases
        https://github.com/piface/pifacedigitalio/releases

     

    Install with:
               
        sudo dpkg -i python3-piface*.deb

     

    Hope that helps.

    Thomas

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 12 years ago in reply to e14 Contributor

    Thank you for the answer!

    Points 1 and 2 are approved and tested.image

     

    One question remains... image

     

    How to toggle, in easy way, an output ?

     

    Joel

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 12 years ago in reply to e14 Contributor

    There are examples at: http://piface.github.io/pifacedigitalio/example.html

     

    To toggle the first relay on the PiFace with hardware address 1:

     

    $ python3

    >>> import pifacedigitalio

    >>> pfd = pifacedigitalio.PiFaceDigital(hardware_addr=1)

    >>> pfd.relays[0].toggle()

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • e14 Contributor
    e14 Contributor over 12 years ago in reply to e14 Contributor

    There are examples at: http://piface.github.io/pifacedigitalio/example.html

     

    To toggle the first relay on the PiFace with hardware address 1:

     

    $ python3

    >>> import pifacedigitalio

    >>> pfd = pifacedigitalio.PiFaceDigital(hardware_addr=1)

    >>> pfd.relays[0].toggle()

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • e14 Contributor
    e14 Contributor over 12 years ago in reply to e14 Contributor

    Thank you verry much to All !

    That run fine !

    Thomas :

    relays[0].toggle()

    Is not in your sample image

    Like:

    leds[0].turn_off

    leds[0].set_low

    and, if I can, what is the diference, betwen this two commands? ...image

    this is not explained ... shame!

    Friendly! good job.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 12 years ago in reply to e14 Contributor

    The examples aren't comprehensive, they just give you an idea of how to use the library. image

     

    `set_low` is more appropriate since your output may be `active low`. That is, setting an output to 'low' does not necessarily mean that it is 'off'. I wanted to add a more approriate naming convention without removing backwards compatibility.

     

    turn_off is aliased to set_low

    turn_on is aliased to set_high

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube