4-Relay Unit control with UiFlow



  • Hi guys!

    I have played a bit with my 4-Relay Unit in UiFlow, and want to share the result for those who want to program it with blockly.

    You can control it with I2C at address 0x26
    The relay control data reg is 0x11 (decimal 17) and the data is the binary state (1-open, 0-closed) of the relays in decimal number.
    If you want to open relay 3, that should be 0100 in binary which is 4 in decimal, so you have to control the relay with the number "4".

    I made a small diagram, I hope it is clear how to use it :)

    0_1615577235686_4relay_control_uiflow.jpg

    And here is the blockly diagram of a full 4-Relay control with a Core 2, using four touch switches for individual relay control:

    0_1615577381495_blockly.JPG



  • Thank you for sharing this.



  • Thanks for the great information.
    And I have a question.
    Is the block in the second half of the last figure a block for 4-Relay Unit?
    My UIFlow (ver.1.7.3) doesn't have a 4-Relay Unit icon, so I can't select it.



  • @rokuemon said in 4-Relay Unit control with UiFlow:

    Thanks for the great information.
    And I have a question.
    Is the block in the second half of the last figure a block for 4-Relay Unit?
    My UIFlow (ver.1.7.3) doesn't have a 4-Relay Unit icon, so I can't select it.

    @rokuemon said in 4-Relay Unit control with UiFlow:

    Thanks for the great information.
    And I have a question.
    Is the block in the second half of the last figure a block for 4-Relay Unit?
    My UIFlow (ver.1.7.3) doesn't have a 4-Relay Unit icon, so I can't select it.

    The relay_control blocks are variables that you create and name.



  • @rokuemon

    Hi!

    No, the blocks you are speaking of (the blue ones with switch0, switch1...) are
    the Core 2's touch switches. You can access them in the UI menu after you put them on screen.
    I put 4 of them on screen, to individually control the 4-Relay.
    The 4-Relay Unit is not represented in UiFlow units, you can not select it.

    0_1616010831313_rel.JPG



  • @lgx
    Thank you for your reply.
    From your information, I knew that it was a Core 2 feature.
    I want to use 4-Relay with my M5stickC.
    I will continue to study UIflow.



  • This post is deleted!


  • @lgx

    @lgx
    Thank you for your information.
    4 Relay works OK directly connected to Core2.
    But how can I connect it using PAHUB ?