From: Brendan Le Foll Date: Wed, 5 Nov 2014 11:20:36 +0000 (+0000) Subject: rgblcd.py: update example to use only writeReg() X-Git-Tag: v0.5.2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ac02940174ec559f7321fc23fa6f3434ce77284e;p=contrib%2Fmraa.git rgblcd.py: update example to use only writeReg() Signed-off-by: Brendan Le Foll --- diff --git a/examples/python/rgblcd.py b/examples/python/rgblcd.py index 7c9d889..a686b2f 100644 --- a/examples/python/rgblcd.py +++ b/examples/python/rgblcd.py @@ -28,10 +28,12 @@ import mraa # to a nice shade of purple x = mraa.I2c(0) x.address(0x62) -x.writeReg(0,0) -x.writeReg(1,0) -# 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\xFF\x02\xFF" -x.write(s) +# initialise device +x.writeReg(0, 0) +x.writeReg(1, 0) + +# sent RGB color data +x.writeReg(0x08, 0xAA) +x.writeReg(0x04, 255) +x.writeReg(0x02, 255)