You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: programming/motors.md
+71-60Lines changed: 71 additions & 60 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,77 +6,83 @@ title: Motor Board API
6
6
Motor Board API
7
7
===============
8
8
9
-
The `motor_board` object is used to control a collection of Motor Boards.
9
+
The kit can control multiple motors simultaneously.
10
+
Each Motor Board can control two motors.
11
+
See the [Motor Board](/docs/kit/motor_board) hardware page for more details.
10
12
11
-
When a single Motor Board is connected to your robot, you can control it
12
-
using the `motor_board` object.
13
+
14
+
Accessing the Motor Board
15
+
-------------------------
16
+
17
+
If there is exactly one Motor Board connected to your robot, it can be accessed using the `motor_board` property of the `Robot` object.
13
18
14
19
~~~~~python
15
-
R.motor_board.something...
20
+
from sr.robot3 import*
21
+
robot = Robot()
22
+
23
+
my_motor_board = robot.motor_board
16
24
~~~~~
17
25
18
-
The serial number of each detected Motor Board is printed to the log when your robot starts.
26
+
If you have more than one Motor Board attached, you need to specify which one you want to control.
27
+
This is done using the serial number of the board.
28
+
29
+
The serial number is physically written on each board and the serial of any connected board will be printed to your log when the robot starts.
19
30
It will look something like this:
20
31
21
32
~~~~~not-code
22
-
sr.robot3.robot INFO - Found Student Robotics Motor Board v4 - srABC1
33
+
sr.robot3.robot - INFO - Found MotorBoard, serial: srABC1
34
+
sr.robot3.robot - INFO - Found MotorBoard, serial: srXYZ1
23
35
~~~~~
24
36
25
-
If you have more than one Motor Board attached, you need to specify which one you want to control. This is done using the serial number of the board. For example: if you had a board that was detected as "srABC1",
0 commit comments