Skip to content

Commit 42f9d4f

Browse files
committed
Merge pull request gpiozero#290 from lurch/patch-3
Update Recipes to use the generic Robot class instead of the specific…
2 parents 8b006e9 + af3476d commit 42f9d4f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/recipes.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -751,10 +751,10 @@ Button controlled robot
751751

752752
Use four GPIO buttons as forward/back/left/right controls for a robot::
753753

754-
from gpiozero import RyanteckRobot, Button
754+
from gpiozero import Robot, Button
755755
from signal import pause
756756

757-
robot = RyanteckRobot()
757+
robot = Robot(left=(4, 14), right=(17, 18))
758758

759759
left = Button(26)
760760
right = Button(16)
@@ -782,9 +782,9 @@ Keyboard controlled robot
782782
Use up/down/left/right keys to control a robot::
783783

784784
import curses
785-
from gpiozero import RyanteckRobot
785+
from gpiozero import Robot
786786

787-
robot = RyanteckRobot()
787+
robot = Robot(left=(4, 14), right=(17, 18))
788788

789789
actions = {
790790
curses.KEY_UP: robot.forward,
@@ -826,10 +826,10 @@ If you prefer a version that works under IDLE, the following recipe should
826826
suffice, but will require that you install the evdev library with ``sudo pip3
827827
install evdev`` first::
828828

829-
from gpiozero import RyanteckRobot
829+
from gpiozero import Robot
830830
from evdev import InputDevice, list_devices, ecodes
831831

832-
robot = RyanteckRobot()
832+
robot = Robot(left=(4, 14), right=(17, 18))
833833

834834
devices = [InputDevice(device) for device in list_devices()]
835835
keyboard = devices[0] # this may vary

0 commit comments

Comments
 (0)