Closed JacobChrist closed 1 year ago
Same result when trying to stuff into a lstring:
function NAU7802_setRegister(registerAddress, value)
data = string.char(value)
result = ez.I2CWrite(_deviceAddress, registerAddress, data, string.len(data))
return result
end
This is a documentation error, I don't have permissions to update the labels. The W in Write should not be capitalized in the lua manual.
ez.I2CWrite(Address, Register, Data [, regSize [, timeout]]) ez.I2CWrite(Address, Register, lstringData, dataSize [, regSize [, timeout]]) should be:
ez.I2Cwrite(Address, Register, Data [, regSize [, timeout]]) ez.I2Cwrite(Address, Register, lstringData, dataSize [, regSize [, timeout]])
Tested both with Data and lstringData, both seem to work (but I will not know for sure until I get the rest of the code working).
Yes, Lua is case-sensitive. I confirmed in the source code that the "W" should be lower-case. Fixed in the manual. I'll push the update to Git as part of a few other minor docs changes.
Describe the bug Attempting to use: ez.I2CWrite(Address, Register, Data [, regSize [, timeout]])
Called like this:
The following error is in LuaError.log [string "ezCmdLua"]:824: attempt to call a nil value (field 'I2CWrite')
Going to attempt to stuff value in to a lstringData.