File tree Expand file tree Collapse file tree 2 files changed +74
-0
lines changed
Expand file tree Collapse file tree 2 files changed +74
-0
lines changed Original file line number Diff line number Diff line change 1+ from bluedot import BlueDot
2+ from signal import pause
3+ import usb_arm
4+
5+ arm = usb_arm .Arm ()
6+
7+ def led_pressed (pos ):
8+ arm .tell (usb_arm .LedOn )
9+
10+ def stop (* args ):
11+ arm .tell (usb_arm .Stop )
12+
13+ bd = BlueDot (cols = 3 , rows = 2 )
14+ led = bd [1 , 0 ]
15+
16+ bd .when_released = stop
17+ led .when_pressed = led_pressed
18+ bd .when_client_disconnects = stop
19+ pause ()
Original file line number Diff line number Diff line change 1+ from bluedot import BlueDot
2+ from signal import pause
3+ import usb_arm
4+
5+ arm = usb_arm .Arm ()
6+
7+ def led_pressed (pos ):
8+ arm .tell (usb_arm .LedOn )
9+
10+
11+ def stop (* args ):
12+ arm .tell (usb_arm .Stop )
13+
14+
15+ def grip_pressed (pos ):
16+ if pos .top :
17+ arm .tell (usb_arm .GripsClose )
18+ if pos .bottom :
19+ arm .tell (usb_arm .GripsOpen )
20+
21+
22+ def wrist_pressed (pos ):
23+ if pos .top :
24+ arm .tell (usb_arm .WristUp )
25+ if pos .bottom :
26+ arm .tell (usb_arm .WristDown )
27+
28+
29+ def elbow_pressed (pos ):
30+ if pos .top :
31+ arm .tell (usb_arm .ElbowUp )
32+ if pos .bottom :
33+ arm .tell (usb_arm .ElbowDown )
34+
35+
36+ def shoulder_pressed (pos ):
37+ if pos .top :
38+ arm .tell (usb_arm .ShoulderUp )
39+ if pos .bottom :
40+ arm .tell (usb_arm .ShoulderDown )
41+
42+
43+ def base_pressed (pos ):
44+ if pos .left :
45+ arm .tell (usb_arm .BaseCtrClockWise )
46+ if pos .right :
47+ arm .tell (usb_arm .BaseClockWise )
48+
49+ bd = BlueDot (cols = 3 , rows = 2 )
50+ led = bd [1 , 0 ]
51+
52+ bd .when_released = stop
53+ led .when_pressed = led_pressed
54+ bd .when_client_disconnects = stop
55+ pause ()
You can’t perform that action at this time.
0 commit comments