Skip to content

Commit af53cb4

Browse files
committed
Add led functions for RPI platform
1 parent 256c9bc commit af53cb4

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

ev3dev.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,6 +1686,36 @@ def Led_all_off():
16861686
Led.all_off = Led_all_off
16871687

16881688

1689+
#~autogen
1690+
elif current_platform() == 'rpi':
1691+
#~autogen python_led-colors platforms.rpi.led>currentClass
1692+
1693+
Led.blue_one = Led(name='brickpi1:blue:ev3dev')
1694+
Led.blue_two = Led(name='brickpi2:blue:ev3dev')
1695+
1696+
@staticmethod
1697+
def Led_mix_colors(blue):
1698+
Led.blue_one.brightness_pct = blue
1699+
Led.blue_two.brightness_pct = blue
1700+
Led.mix_colors = Led_mix_colors
1701+
1702+
@staticmethod
1703+
def Led_set_blue(pct):
1704+
Led.mix_colors(blue=1*pct)
1705+
Led.set_blue = Led_set_blue
1706+
1707+
@staticmethod
1708+
def Led_blue_on():
1709+
Led.set_blue(1)
1710+
Led.blue_on = Led_blue_on
1711+
1712+
@staticmethod
1713+
def Led_all_off():
1714+
Led.blue_one.brightness = 0
1715+
Led.blue_two.brightness = 0
1716+
Led.all_off = Led_all_off
1717+
1718+
16891719
#~autogen
16901720
#~autogen python_generic-class classes.powerSupply>currentClass
16911721

0 commit comments

Comments
 (0)