You are reading a single comment by @CriscoCrusader and its replies. Click here to read the full conversation.
  • Hi @Gordon. I ran the I2C scanner script from the other thread, I don't get any positive results. If the address bits are shifted, wouldn't the scanner still find the devices?

    @ClearMemory041063, good find. Actually I think this wasn't that hard. But there's a few pieces I'm uncertain of. Is this line a function?
    #define CHECK_BIT(var,pos) ((var) & (1<<(pos)))

    So my guess is it becomes this:
    function CHECK_BIT (val, pos) { return ((val) & (1<<(pos))); }

    And the init_i2c function is puzzling to me. Looks like init_i2c("/dev/i2c-1"); is akin to calling I2C1.setup().

    Looks like the substring function isn't being used, so fortunately I can take that out. The pointer stuff there is beyond me, but I'm guessing it works like slice().

    Here's my first attempt at a rewrite.
    https://gist.github.com/stokebrain/e7956­dc7b5f1f62f3a54e1a820042526
    (the getliner() function needs to be updated still)

About