You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ReadByte()/WriteByte() don't rely on Read(buf)/Write(buf) but call the "littlewire.i2cRead(b, 1, 1)"/"littleWire.i2cWrite(b, 1, 1)" directly. This results in missing START-condition, which is normally done with littleWire.i2cStart(c.address, 1), refer to Read(buf)/Write(buf)-function. Therefore all functions based on ReadByte()/WriteByte will not working like expected, which is currently only ReadByteData(). For working example, see firmata_i2c.go
I will provide a bugfix asap, this could be a workaround:
func (c *digisparkI2cConnection) ReadByte() (val byte, err error) {
buf := []byte{0}
if _, err = c.Read(buf); err != nil {
return
}
val = buf[0]
return
}
The text was updated successfully, but these errors were encountered:
ReadByte()/WriteByte() don't rely on Read(buf)/Write(buf) but call the "littlewire.i2cRead(b, 1, 1)"/"littleWire.i2cWrite(b, 1, 1)" directly. This results in missing START-condition, which is normally done with littleWire.i2cStart(c.address, 1), refer to Read(buf)/Write(buf)-function. Therefore all functions based on ReadByte()/WriteByte will not working like expected, which is currently only ReadByteData(). For working example, see firmata_i2c.go
I will provide a bugfix asap, this could be a workaround:
func (c *digisparkI2cConnection) ReadByte() (val byte, err error) {
buf := []byte{0}
if _, err = c.Read(buf); err != nil {
return
}
val = buf[0]
return
}
The text was updated successfully, but these errors were encountered: