Need SN3218 to enable output before functions will work?
Closed this issue · 2 comments
On my Raspbian installation on a Model B Pi, I need to tell the SN3218 to enable output before any of the
functions work. If I don't then all python code runs without errors but none of the leds
light up.
So I need to run
piglow.bus.write_i2c_block_data(0x54,0x00,[0x01])
then everything works fine. In fact, any leds that have previously been activated will then light up.
Example:
pi@raspberrypi ~/PiGlow $ sudo python
Python 2.7.3 (default, Jan 13 2013, 11:20:46)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
from piglow import PiGlow
piglow = PiGlow(1)
piglow.orange(50)nothing happens - the leds don't light
piglow.bus.write_i2c_block_data(0x54,0x00,[0x01])
the 3 oranges leds light up
piglow.arm1(45)
all subsequent functions work straight away
You should only need to run this line of code once after each cold start of the Pi. The
SN3218 should remain enabled until power is removed.
Also, the psutils package on raspbian (which I reckon a lot of people will be using) is
called python-psutil.
Thanks for these great scripts!
Brill thanks for the info, I'll look into it when I I'm in front of my Pi again.
I'll give it a proper vanilla test and document everything that needs doing, as items like psutil only gets installed once and forget about it, and it nearly slipped my memory when adding it!
Fixed and added, cheers topshed!