1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Understanding return codes form 16 port USB gpio

Discussion in 'GPIO Modules' started by NoMail, Mar 1, 2017.

  1. NoMail

    NoMail New Member

    Joined:
    Mar 1, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    Location:
    Office
    I have as the title woudl imply the 16 port GPIO USB module.
    This is my first time working with this product.

    Tee end goal is to get change notification from IO 0-7 and then after IDing which state changed, read the value present in the ADC for that IO.

    I am having difficulty quite understanding what the output in the notify string indicated sin relation to which IOs are engaged.

    For instance the following output was while I had GND => 04 and GND => 00

    006F 006E 007F
    007F 006F 007F
    006F 007F 007F
    007F 006F 007F

    I realize they are hex representations of a binary number, but for instance if I take that first set

    006F => 01101111 => 111

    How does that state that I had 0 and 4 active?

    Essentially I need more detail on how those three hex sets break down and what they represent when a notify event comes in.
     
  2. NoMail

    NoMail New Member

    Joined:
    Mar 1, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    Location:
    Office
    Never mind, I figured it out I think, the first number is the current state, the second is the previous state.
    and each is a hi/low of the state of each ADC in that set. So as the zero moves (or their count increases) then the coresponding inde9s) change with it.

    upload_2017-3-1_11-14-51.png

    So converting the first and second hex to bin and then doing an index by index comparison allows me to with each event see what is on/off and if it has changed from the last read. Nice device, I will be reusing this API for sure for some home projects!
     

Share This Page