Skip to content
This repository was archived by the owner on Mar 3, 2019. It is now read-only.

Commit 82c5fc0

Browse files
committed
mode de control indiqué par les DELs de la wiimote
1 parent a3eee0c commit 82c5fc0

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

wiimote/wiimote_controler_python2.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def check_connectivity():
8484

8585
# List of mode : 'wiimote_std' 'wiimote_horizontal' 'nunchuk'
8686
control_mode = 'wiimote_std'
87+
wii.led = cwiid.LED1_ON
8788
absolute_speed = 0
8889
speed_list = [300, 500, 750, 1000]
8990

@@ -120,7 +121,6 @@ def check_connectivity():
120121
# thread.start_new_thread(check_connectivity, ())
121122

122123
try:
123-
wii.led = 1
124124
while True:
125125
buttons = wii.state['buttons']
126126

@@ -141,12 +141,14 @@ def check_connectivity():
141141
if control_mode != 'nunchuk':
142142
wii.rpt_mode = cwiid.RPT_BTN | cwiid.RPT_NUNCHUK
143143
control_mode = 'nunchuk'
144+
wii.led = cwiid.LED3_ON
144145
robot_stop()
145146
print "Control mode : nunchuk"
146147
else:
147148
if control_mode == 'nunchuk':
148149
wii.rpt_mode = cwiid.RPT_BTN | cwiid.RPT_ACC
149150
control_mode = 'wiimote_std'
151+
wii.led = cwiid.LED1_ON
150152
robot_stop()
151153
print "Control mode : wiimote_std"
152154

@@ -155,9 +157,11 @@ def check_connectivity():
155157
b_home_p = True
156158
if control_mode == 'wiimote_std':
157159
control_mode = 'wiimote_horizontal'
160+
wii.led = cwiid.LED2_ON
158161
print "Control mode : wiimote_horizontal"
159162
elif control_mode == 'wiimote_horizontal':
160163
control_mode = 'wiimote_std'
164+
wii.led = cwiid.LED1_ON
161165
print "Control mode : wiimote_std"
162166
else:
163167
print "Control mode : nunchuk"

0 commit comments

Comments
 (0)