Skip to content

Commit 0662d33

Browse files
committed
Back to uppercase R for Robot instance
1 parent 111e9e1 commit 0662d33

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

programming/sr/power/index.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ There are a few things that can be done with the power board, namely current and
1010
As there is only one power board, it is not accessed like a list like `motors` and is instead accessed directly, for example:
1111

1212
~~~~~ python
13-
r.power_board.something...
13+
R.power_board.something...
1414
~~~~~
1515

1616
[Power Outputs](#outputs) {#outputs}
@@ -33,25 +33,25 @@ While they are all turned on when your code starts running,
3333
from sr.robot3 import *
3434

3535
# Turn output H0 off
36-
r.power_board.outputs[OUT_H0].is_enabled = False
36+
R.power_board.outputs[OUT_H0].is_enabled = False
3737

3838
# Turn output L0 on
39-
r.power_board.outputs[OUT_L0].is_enabled = True
39+
R.power_board.outputs[OUT_L0].is_enabled = True
4040

4141
# Find out whether L3 is enabled
42-
print(r.power_board.outputs[OUT_L3].is_enabled)
42+
print(R.power_board.outputs[OUT_L3].is_enabled)
4343

4444
# Find the current (in Amps) being used by L3
45-
print(r.power_board.outputs[OUT_L3].current)
45+
print(R.power_board.outputs[OUT_L3].current)
4646
~~~~~
4747

4848
An exception is raised if you try to set an output index which doesn't exist.
4949

5050
You can also control all the outputs together:
5151

5252
~~~~~ python
53-
r.power_board.outputs.power_off()
54-
r.power_board.outputs.power_on()
53+
R.power_board.outputs.power_off()
54+
R.power_board.outputs.power_on()
5555
~~~~~
5656

5757
<div class="warning">
@@ -70,8 +70,8 @@ You can access these values like so:
7070
~~~~~ python
7171
# Print the battery voltage and current to the log
7272
print(
73-
r.power_board.battery_sensor.voltage,
74-
r.power_board.battery_sensor.current,
73+
R.power_board.battery_sensor.voltage,
74+
R.power_board.battery_sensor.current,
7575
)
7676
~~~~~
7777

@@ -109,10 +109,10 @@ between `C6` and `C8`. You can play other tones by providing a frequency.
109109
from sr.robot3 import Note
110110

111111
# Beep for 0.5s in D.
112-
r.power_board.piezo.buzz(0.5, Note.D6)
112+
R.power_board.piezo.buzz(0.5, Note.D6)
113113

114114
# Beep for 2s at 400Hz
115-
r.power_board.piezo.buzz(2, 400)
115+
R.power_board.piezo.buzz(2, 400)
116116
~~~~~
117117

118118
`ValueError` is raised if the note is not recognised or the frequency is not an integer.

0 commit comments

Comments
 (0)