2014-06-24 14:40:34 +01:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
|
|
# Author: Brendan Le Foll <brendan.le.foll@intel.com>
|
|
|
|
|
# Copyright (c) 2014 Intel Corporation.
|
|
|
|
|
#
|
2019-05-09 09:47:11 -07:00
|
|
|
# SPDX-License-Identifier: MIT
|
2018-01-30 11:32:18 +05:30
|
|
|
#
|
|
|
|
|
# Example Usage: Changes the Grove-LCD RGB backlight to a nice shade of purple
|
2014-06-24 14:40:34 +01:00
|
|
|
|
2014-06-25 17:49:27 +01:00
|
|
|
import mraa
|
2014-06-24 14:40:34 +01:00
|
|
|
|
2018-01-30 11:32:18 +05:30
|
|
|
# initialise I2C
|
2014-06-24 17:24:54 +01:00
|
|
|
x = mraa.I2c(0)
|
2014-06-24 14:40:34 +01:00
|
|
|
x.address(0x62)
|
|
|
|
|
|
2014-11-05 11:20:36 +00:00
|
|
|
# initialise device
|
|
|
|
|
x.writeReg(0, 0)
|
|
|
|
|
x.writeReg(1, 0)
|
|
|
|
|
|
2018-01-30 11:32:18 +05:30
|
|
|
# write RGB color data
|
2014-11-05 11:20:36 +00:00
|
|
|
x.writeReg(0x08, 0xAA)
|
|
|
|
|
x.writeReg(0x04, 255)
|
|
|
|
|
x.writeReg(0x02, 255)
|