From af3476d570146b3d99145d1fb475c03736acc850 Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Tue, 19 Apr 2016 17:25:23 +0100 Subject: [PATCH] Update Recipes to use the generic Robot class instead of the specific RyanteckRobot Fixes #288 --- docs/recipes.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/recipes.rst b/docs/recipes.rst index ed02720..f77a1f7 100644 --- a/docs/recipes.rst +++ b/docs/recipes.rst @@ -539,10 +539,10 @@ Button controlled robot Use four GPIO buttons as forward/back/left/right controls for a robot:: - from gpiozero import RyanteckRobot, Button + from gpiozero import Robot, Button from signal import pause - robot = RyanteckRobot() + robot = Robot(left=(4, 14), right=(17, 18)) left = Button(26) right = Button(16) @@ -570,9 +570,9 @@ Keyboard controlled robot Use up/down/left/right keys to control a robot:: import curses - from gpiozero import RyanteckRobot + from gpiozero import Robot - robot = RyanteckRobot() + robot = Robot(left=(4, 14), right=(17, 18)) actions = { curses.KEY_UP: robot.forward, @@ -614,10 +614,10 @@ If you prefer a version that works under IDLE, the following recipe should suffice, but will require that you install the evdev library with ``sudo pip install evdev`` first:: - from gpiozero import RyanteckRobot + from gpiozero import Robot from evdev import InputDevice, list_devices, ecodes - robot = RyanteckRobot() + robot = Robot(left=(4, 14), right=(17, 18)) devices = [InputDevice(device) for device in list_devices()] keyboard = devices[0] # this may vary