Skip to content

Commit 234a6ca

Browse files
committed
update programming/sr page
1 parent f4c4cd5 commit 234a6ca

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

programming/sr/index.md

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,9 @@ R = Robot()
3434

3535
Within your `Robot` (`R` in this case), you then have access to the following attributes:
3636

37-
* [compass](/docs/programming/sr/compass/)
3837
* [motors](/docs/programming/sr/motors/)
3938
* [power](/docs/programming/sr/power/)
4039
* [servos](/docs/programming/sr/servos/)
41-
* [radio](/docs/programming/sr/radio/)
4240
* [ruggeduinos](/docs/programming/sr/ruggeduinos/)
4341
* [vision](/docs/programming/sr/vision/)
4442

@@ -47,15 +45,15 @@ Note that `motors`, `ruggeduinos`, and `servos` are Python lists, and so should
4745
Here are some examples:
4846

4947
~~~~~ python
50-
R.motors[0].m0.power = 50 # WILL work, if motor 0 exists
51-
R.motors[1].m0.power = -20 # WILL work, if motor 1 exists
52-
R.motors.m0.power = 42 # WON'T WORK
48+
R.motor_board.motors[0].power = 50 # WILL work, if motor 0 exists
49+
R.motor_board.motors[1].power = -20 # WILL work, if motor 1 exists
50+
R.motor_board.motors.power = 42 # WON'T WORK
5351

5452
# the above is similar to the situation for 'ruggeduinos' and 'servos'
5553
~~~~~
5654

5755
A number of examples in the documentation will assume you've instantiated the required `Robot` class and have called it `R`.
58-
From here in, if you see a `R.something`, the requirement of the `sr.robot` import line and the instantiation of `Robot` as `R` is implicit.
56+
From here in, if you see a `R.something`, the requirement of the `sr.robot3` import line and the instantiation of `Robot` as `R` is implicit.
5957

6058
[Other Robot Attributes](#OtherRobotAttributes) {#OtherRobotAttributes}
6159
----------------------
@@ -77,7 +75,7 @@ usbkey
7775
An example of how the `usbkey` attribute might be used:
7876

7977
~~~~~ python
80-
from sr.robot import *
78+
from sr.robot3 import *
8179
import os
8280

8381
R = Robot()
@@ -104,23 +102,14 @@ However if you want to:
104102
Then Robot initialisation can be broken up as follows (this example is equivalent to the previous code excerpt):
105103

106104
~~~~~ python
107-
R = Robot.setup()
108-
109-
# Setup phase.
110-
# Here you can configure hardware enumeration
111-
112-
R.init()
105+
R = Robot(auto_start=True)
113106

114107
# Initialisation phase.
115108
# Here you can perform hardware/software initialisation before start
116109

117110
R.wait_start()
118111
~~~~~
119112

120-
During the setup phase, the Robot hardware is inaccessible.
121-
For example, `R.motors` is unavailable since enumerations occurs in the `init` function.
122-
In this phase you can configure how the Robot finds and configures hardware.
123-
124-
After the `init` call, all hardware is accessible.
113+
During the initialisation phase, all hardware is accessible.
125114
If you have any hardware which must be initialised before the start button is pressed,
126115
the initialisation phase is the time to do so.

0 commit comments

Comments
 (0)