File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ # SPDX-License-Identifier: MIT
2+ # Copyright (c) 2020 The Pybricks Authors
3+
4+ """
5+ Hardware Module: 1
6+
7+ Description: Verifies data logging capability.
8+ """
9+
10+ from pybricks .pupdevices import Motor
11+ from pybricks .tools import wait
12+ from pybricks .parameters import Port
13+
14+ # Initialize the motor.
15+ motor = Motor (Port .A )
16+
17+ # Rotate the motor to base position.
18+ motor .run_target (500 , 0 )
19+ wait (500 )
20+
21+ # Allocate logs for motor and controller signals.
22+ DURATION = 2000
23+ motor .log .start (DURATION )
24+ motor .control .log .start (DURATION )
25+
26+ # Rotate the motor.
27+ motor .run_target (500 , 360 )
28+
29+ # Wait so we can also log hold capability, then turn off the motor completely.
30+ wait (1000 )
31+ motor .stop ()
32+
33+ # Save the data by printing it. Pybricksdev will capture the printed
34+ # data and save it to the given path relative to this script.
35+ motor .log .save ('build/servo_data.txt' )
36+ motor .control .log .save ('build/control_data.txt' )
You can’t perform that action at this time.
0 commit comments