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: simulator/simulator_programming.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,7 @@ The main differences are the way that [time is handled](#simulated-time), some d
63
63
64
64
Your robot has one motor board attached, the left wheel is connected to the first port, and the right wheel to the second.
65
65
66
-
The motor board has the part code `srABC1`, since only a single motor board is attached it can be referenced as `R.motor_board`.
66
+
The motor board has the part code `srABC1`, since only a single motor board is attached it can be referenced as `robot.motor_board`.
67
67
68
68
### Servos
69
69
@@ -79,7 +79,7 @@ Setting each servo to -1 fully opens the respective jaw, setting them to 1 fully
79
79
80
80
Setting the lifter to -1 fully lowers the lifter, setting it to 1 fully raises it.
81
81
82
-
The servo board has the part code `srXYZ2`, but since only a single servo board is attached it can be referenced as `R.servo_board`.
82
+
The servo board has the part code `srXYZ2`, but since only a single servo board is attached it can be referenced as `robot.servo_board`.
83
83
84
84
### Arduino
85
85
@@ -144,12 +144,12 @@ running for or `time.sleep` to wait for some duration will be unreliable.
144
144
145
145
As a result the API present in the simulator supports a slightly different
146
146
approach to handling time.
147
-
The methods `R.time` and `R.sleep` are provided as a direct replacement of `time.time` and `time.sleep` respectively and can be used anywhere the previous methods were used.
147
+
The methods `robot.time` and `robot.sleep` are provided as a direct replacement of `time.time` and `time.sleep` respectively and can be used anywhere the previous methods were used.
148
148
149
149
<divclass="warning">
150
-
Since the simulator does not simulate the time taken to execute your code, any loop or decision which needs an event to occur must be accompanied by a <code>R.sleep</code> even if with a small value.
150
+
Since the simulator does not simulate the time taken to execute your code, any loop or decision which needs an event to occur must be accompanied by a <code>robot.sleep</code> even if with a small value.
151
151
152
-
<b>If in doubt add an <code>R.sleep</code></b>.
152
+
<b>If in doubt add an <code>robot.sleep</code></b>.
153
153
154
-
If you find that the simulator freezes then this indicates that your code is reaching a loop which does not contain any <code>R.sleep</code> and is expecting time to advance.
154
+
If you find that the simulator freezes then this indicates that your code is reaching a loop which does not contain any <code>robot.sleep</code> and is expecting time to advance.
0 commit comments