Read from I2C/TWI Hardware Device
res = twi.rd( dev, num )
res = twi.rd( {dev, addr}, num)
res = twi.rd( t, num )
Read from a device on the I2C bus.
Parameter | Type | Description |
---|---|---|
dev |
integer | Device number |
num |
integer | Number of bytes to read |
addr |
integer | Internal register to read |
t |
table | Table of values |
Returns | Type | Description |
---|---|---|
res |
string | Binary data |
t Value |
Type | Description |
---|---|---|
dev |
integer | Device number |
addr |
integer | Internal register to read |
alen |
integer | Number of bytes for the address. Default = 1 |
slow |
integer | Slow setting |