Skip to content

Commit bc2d0f5

Browse files
committed
fixes #127
1 parent 749ebff commit bc2d0f5

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

course/driving/waiting_for_button_input.rst

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,23 @@ buttons to tell the code when to run.
1010
The XRP has a button which you can read from code. To make it easy, **XRPLib**
1111
has a built in function which will wait for the button to be pressed for you.
1212

13-
.. code-block:: python
14-
15-
from XRPLib.defaults import *
16-
from time import sleep
13+
.. tab-set::
14+
15+
.. tab-item:: Python
16+
17+
.. code-block:: python
18+
19+
from XRPLib.defaults import *
20+
from time import sleep
21+
22+
board.wait_for_button()
23+
sleep(1)
24+
drivetrain.straight(20)
25+
26+
.. tab-item:: Blockly
1727

18-
board.wait_for_button()
19-
sleep(1)
20-
drivetrain.straight(20)
28+
.. image:: media/waitForButton.png
29+
:width: 300
2130

2231
This function is part of :code:`board` since the button is on the XRP's main
2332
controller board.

0 commit comments

Comments
 (0)