Permalink
Browse files

v0.3 commit

Added fixes by topshed for enabling LED's and added arm.py
  • Loading branch information...
1 parent d614da7 commit c299a42f7faf8a0f8ccc4a385ad41fc110c34eeb @Boeeerb committed Aug 17, 2013
Showing with 49 additions and 3 deletions.
  1. BIN LED_addressing.jpg
  2. BIN PiGlow_Addressing.jpg
  3. +7 −1 README.md
  4. BIN SN3218_addressing.jpg
  5. +35 −0 arm.py
  6. +0 −1 cpu.py
  7. +7 −1 piglow.py
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Deleted file not rendered
View
@@ -2,8 +2,14 @@
Here is a small Python module for the PiGlow addon by Pimoroni, it will let you flex the LED muscles of this fantastic addon.
+## SN3218 Addressing
<p align="center">
-<img src="https://raw.github.com/Boeeerb/PiGlow/master/PiGlow_Addressing.jpg" alt="PiGlow Addressing"/>
+<img src="https://raw.github.com/Boeeerb/PiGlow/master/SN3218_addressing.jpg" alt="PiGlow Addressing"/>
+</p>
+
+## Python LED Addressing
+<p align="center">
+<img src="https://raw.github.com/Boeeerb/PiGlow/master/LED_addressing.jpg" alt="PiGlow Addressing"/>
</p>
## Files
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
35 arm.py
@@ -0,0 +1,35 @@
+#########################################################
+## Set each arm of the PiGlow to a specific brightness ##
+## ##
+## Example by Jason - @Boeeerb ##
+#########################################################
+
+from piglow import PiGlow
+from time import sleep
+
+piglow = PiGlow(1)
+
+piglow.all(0)
+
+while True:
+ piglow.arm(3,0)
+ piglow.arm(1,20)
+ sleep(0.5)
+ piglow.arm(1,0)
+ piglow.arm(2,20)
+ sleep(0.5)
+ piglow.arm(2,0)
+ piglow.arm(3,20)
+ sleep(0.5)
+
+ piglow.all(0)
+ piglow.arm1(10)
+ sleep(0.5)
+ piglow.all(0)
+ piglow.arm2(10)
+ sleep(0.5)
+ piglow.all(0)
+ piglow.arm3(10)
+ sleep(0.5)
+
+
View
1 cpu.py
@@ -12,7 +12,6 @@
piglow = PiGlow(1)
-
while True:
cpu = psutil.cpu_percent()
View
@@ -1,8 +1,13 @@
#####################################################
## Python module to control the PiGlow by Pimoroni ##
## ##
-## Written by Jason - @Boeeerb - v0.2 15/08/13 ##
+## Written by Jason - @Boeeerb - v0.3 17/08/13 ##
#####################################################
+##
+## v0.3 - Added fix from topshed
+## v0.2 - Code cleanup by iiSeymour
+## v0.1 - Initial release
+##
from smbus import SMBus
@@ -13,6 +18,7 @@ class PiGlow:
def __init__(self, i2c_bus=1):
self.bus = SMBus(i2c_bus)
+ self.bus.write_i2c_block_data(0x54, 0x00, [0x01])
self.bus.write_byte_data(0x54, 0x13, 0xFF)
self.bus.write_byte_data(0x54, 0x14, 0xFF)
self.bus.write_byte_data(0x54, 0x15, 0xFF)

0 comments on commit c299a42

Please sign in to comment.