Re: I2C problem
Posted:
Sat Nov 29, 2014 6:17 pm
by gerardwr
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.
Re: I2C problem
Posted:
Sat Nov 29, 2014 6:21 pm
by sancho
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
Re: I2C problem
Posted:
Sat Nov 29, 2014 6:22 pm
by sancho
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
Re: I2C problem
Posted:
Sat Nov 29, 2014 6:25 pm
by gerardwr
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.