Skip to content

Commit 48e1451

Browse files
committed
Canonicalise around robot for Robot instances
This matches the rest of the docs and follows from b510d8b as well as other recent refactorings.
1 parent 4786f80 commit 48e1451

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

simulator/simulator_programming.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ The main differences are the way that [time is handled](#simulated-time), some d
6363

6464
Your robot has one motor board attached, the left wheel is connected to the first port, and the right wheel to the second.
6565

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`.
6767

6868
### Servos
6969

@@ -79,7 +79,7 @@ Setting each servo to -1 fully opens the respective jaw, setting them to 1 fully
7979

8080
Setting the lifter to -1 fully lowers the lifter, setting it to 1 fully raises it.
8181

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`.
8383

8484
### Arduino
8585

@@ -144,12 +144,12 @@ running for or `time.sleep` to wait for some duration will be unreliable.
144144

145145
As a result the API present in the simulator supports a slightly different
146146
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.
148148

149149
<div class="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.
151151

152-
<b>If in doubt add an <code>R.sleep</code></b>.
152+
<b>If in doubt add an <code>robot.sleep</code></b>.
153153

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.
155155
</div>

0 commit comments

Comments
 (0)