Left here for archival purposes.

User avatar
By gerardwr
#3554 I suggest that you consider to continue this topic as an EXAMPLE in the Lua Examples section.

Might be a PROBLEM for you now, but it's more of a worthwhile Example with some "remaining issues".

Just a thought.
User avatar
By sancho
#3555
gerardwr wrote:Good luck, let us know how it goes, keep posting your working code, that helps others.

That's IT!
Thanks, helped.
The code is now like this:
Code: Select all    -- get content of register 0xAA of device 0x77
    write_reg(0x20, 0x00, 0x00) -- set bank A to output

    for i=0,255 do
      print("Setting bank A to value " .. i)
      write_reg(0x20, 0x12, i)
      tmr.delay(100000)
      tmr.wdclr()
    end

And it works beautifly!
Seems like my kids are going to miss me tomorrow :)
User avatar
By sancho
#3556
gerardwr wrote:I suggest that you consider to continue this topic as an EXAMPLE in the Lua Examples section.

Thanks for the suggestion - I am about to try - that would be my first example ever :)
User avatar
By gerardwr
#3557 Had no clue what a MCP23017 is, it's a I2C IO-expander with 16 GPIO pins.

I read somewhere about I2C IO-expanders with some digital AND analog IO's. Have some experience with them? Could be a solution for all the people that cry over not having a connection to the ADC TOUT pin on their ESP board.