Skip to content

Commit 08de3f0

Browse files
joystick: Replace tabs by space in example
Signed-off-by: Francois Berder <fberder@outlook.fr>
1 parent 086807d commit 08de3f0

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

examples/joystick_example.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@
1515
MAXIMUM = OFFSET2
1616

1717
def get_led_mask(perc):
18-
div = int((1. - perc)led.LED_CNT)
19-
if div > led.LED_CNT:
20-
div = led.LED_CNT
18+
div = int((1. - perc)led.LED_CNT)
19+
if div > led.LED_CNT:
20+
div = led.LED_CNT
2121

22-
mask = 0
23-
for i in range(div):
24-
mask |= (1 << i)
22+
mask = 0
23+
for i in range(div):
24+
mask |= (1 << i)
2525

26-
return mask
26+
return mask
2727

2828
i2c.init()
2929
led.init()
3030

3131
while True:
32-
pos = joystick.get_position()
33-
print('{} {}'.format(pos[0], pos[1]))
34-
mask = get_led_mask(float(pos[0] + OFFSET)/float(MAXIMUM))
35-
led.switch_on(mask)
36-
led.switch_off(~mask)
32+
pos = joystick.get_position()
33+
print('{} {}'.format(pos[0], pos[1]))
34+
mask = get_led_mask(float(pos[0] + OFFSET)/float(MAXIMUM))
35+
led.switch_on(mask)
36+
led.switch_off(~mask)
3737

3838
i2c.release()
3939
led.release()

0 commit comments

Comments
 (0)