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: docs/programming/index.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,14 +14,17 @@ kit:
14
14
```python
15
15
from sbot import*
16
16
17
-
r= Robot()
17
+
robot= Robot()
18
18
```
19
19
20
20
Once this has been done, this `Robot` object can be used to control the
21
21
robot's functions.
22
22
23
23
The remainder of the tutorials pages will assume your `Robot` object is
24
-
defined as `r`.
24
+
defined as `robot`.
25
+
26
+
!!! note
27
+
In Python, variables are case-sensitive. `robot` is an instance of `Robot`.
25
28
26
29
## Running your code
27
30
@@ -47,11 +50,11 @@ what it didn't do, and any errors it raised. The file is saved to log.txt in the
47
50
If you want to do things before the start button press, such as setting up servos or motors, you can pass `wait_start` to the `Robot` constructor. You will then need to wait for the start button manually.
48
51
49
52
```python
50
-
r= Robot(wait_start=False)
53
+
robot= Robot(wait_start=False)
51
54
52
55
# Do your setup here
53
56
54
-
r.wait_start()
57
+
robot.wait_start()
55
58
```
56
59
57
60
## Debug mode
@@ -62,7 +65,8 @@ In "Debug Mode", your robot will print more information about what it is doing.
Copy file name to clipboardExpand all lines: docs/programming/motor-board.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,19 +9,19 @@ If there is exactly one motor board attached to your robot, it can be
9
9
accessed using the `motor_board` property of the `Robot` object.
10
10
11
11
```python
12
-
my_motor_board =r.motor_board
12
+
my_motor_board =robot.motor_board
13
13
```
14
14
15
15
!!! warning
16
-
If there is more than one motor board on your kit, you *must* use the `motor_boards` property. `r.motor_board`*will cause an error*. This is because the kit doesn't know which motor board you want to access.
16
+
If there is more than one motor board on your kit, you *must* use the `motor_boards` property. `robot.motor_board`*will cause an error*. This is because the kit doesn't know which motor board you want to access.
17
17
18
18
Motor boards attached to your robot can be accessed under the
19
19
`motor_boards` property of the `Robot`. The boards are indexed by their
0 commit comments