• Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Simplest way to work with Relays with Python

    General Discussion
    2
    2
    25
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      RaspBeginner last edited by

      Hi guys,
      I am really new at this. I am trying to use a unipi1.1 with python from a RaspberryPi 4.
      I managed to read the GPIO, with some buttons attached but I cannot figure out how to turn on and off the relays.

      What would be the simplest way to do it?

      Thnak you in advance.

      Martin Kudláček 1 Reply Last reply Reply Quote 0
      • Martin Kudláček
        Martin Kudláček administrators @RaspBeginner last edited by

        Hi @RaspBeginner,
        the relays are connected via I2C expander MCP23008. You can communicate directly with the chip by using e.g. this tutorial: https://learn.adafruit.com/using-mcp23008-mcp23017-with-circuitpython/python-circuitpython

        Or, which is more preffered way, to use our API called Evok: https://github.com/UniPiTechnology/evok. With this API, you will get a uniform access to all IOs across all our products.

        Best regards,
        Martin

        1 Reply Last reply Reply Quote 0
        • First post
          Last post