Private
Public Access
2
0

i2c: allow binary strings as parameters to write() functions in scripting

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2014-07-01 13:51:03 +01:00
parent cf1881a978
commit 70ba5a56ab
4 changed files with 19 additions and 14 deletions

View File

@@ -30,7 +30,8 @@ x = mraa.I2c(0)
x.address(0x62)
x.writeReg(0,0)
x.writeReg(1,0)
x.writeReg(0x08,0xAA)
x.writeReg(0x04,255)
x.writeReg(0x02,255)
# Be careful that your i2c device can actually handle a 'batch' handling of
# such data, this is not typical in arduino type devices
s = "\x08\xAA\x04\x255\x02\x255"
x.write(s)