When I follow the steps and run the code:
from gpiozero import Robot
robby = Robot(left=(7,8), right=(9,10)
And the in the shell run:
robby.forward()
I get the error:
NameError: 'robby' is not defined
Can anyone help?
I am having this same problem. The syntax is correct and it even executes in mu. Unfortunately I can't get it to work in the Python shell. Does anyone know of a way to fix this problem?
Same problem as above, have you tried the suggested solution? Don't try to run the commands from the command shell or python shell just add them to the python script.
The inability to use the robby object is probably a consequence of the typing error when you tried to create it.
JV1 wrote: ↑Tue May 19, 2020 11:40 amHi, we are having the same problem. I have checked syntax and all is correct as per instructions. Does anyone have a solution to this one yet? python code runs in mu. get the same error as others in the terminal as below
pi@raspberrypi:~ $ python
Python 2.7.16 (default, Oct 10 2019, 22:02:15)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> robby.forward()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'robby' is not defined
>>>
really appreciate some help as we are new to this.
Does anyone have a solution to this one yet?
Code: Select all
from gpiozero import Robot
robby = Robot(left=(7,8), right=(9,10))
Code: Select all
from gpiozero import Robot
robby = Robot(left=(7,8), right=(9,10))
robby.forward()