File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ from pybricks .pupdevices import Motor
2+ from pybricks .tools import wait
3+ from pybricks .parameters import Port
4+ from pybricks import version
5+
6+ print (version )
7+
8+ # Initialize the motor.
9+ motor = Motor (Port .A )
10+
11+ # Allocate the data logs.
12+ DURATION = 16000
13+ motor .log .start (DURATION , 2 )
14+
15+ wait (5000 )
16+
17+ # Transfer data logs.
18+ print ("Transferring data..." )
19+ motor .log .save ("servo.txt" )
20+ print ("Done" )
Original file line number Diff line number Diff line change 1+ from pybricks .pupdevices import Motor
2+ from pybricks .tools import wait
3+ from pybricks .parameters import Port
4+ from pybricks import version
5+
6+ print (version )
7+
8+ # Initialize the motor.
9+ motor = Motor (Port .A )
10+
11+ # Allocate the data logs.
12+ DURATION = 16000
13+ motor .log .start (DURATION , 2 )
14+ motor .control .log .start (DURATION , 2 )
15+
16+ # Hold the motor.
17+ motor .hold ()
18+ wait (DURATION )
19+ motor .stop ()
20+
21+ # Transfer data logs.
22+ print ("Transferring data..." )
23+ motor .log .save ("servo.txt" )
24+ motor .control .log .save ("control.txt" )
25+ print ("Done" )
You can’t perform that action at this time.
0 commit comments