Closed AhmyOhlin closed 4 years ago
Did you use the SD card image from LEGO Education?
I'm having a similar issues, my code, code is been commented out but I believe my problem is with the #!/usr/bin/env pybricks-micropython#
#!/usr/bin/env pybricks-micropython
from pybricks import ev3brick as brick
from pybricks.ev3devices import (Motor, TouchSensor, ColorSensor,
InfraredSensor, UltrasonicSensor, GyroSensor)
from pybricks.parameters import (Port, Stop, Direction, Button, Color,
SoundFile, ImageFile, Align)
from pybricks.tools import print, wait, StopWatch
from pybricks.robotics import DriveBase
brick.sound.beep()
#Initialize a motor at port B.
test_motor = Motor (Port.B)
#Run the Motor up to 500 degrees per second to a target of 90 degrees.
#then go in the opposite direction for one rotation 360 degrees
Print ("Motor Test Start")
#test_motor.run_target(500, 90)
#dtest_motor.run_target(-500,360)
#Play another beep sound.
#This time with a higer ptich (1000 Hz) and longer duration (500ms)
brick.sound.beep(1000,500)
Print ("Motor Test End")
and the output as I attempt to debug:
Starting: brickrun --directory="/home/robot/First_EV3_Program" "/home/robot/First_EV3_Program/MotorTestv1f.py"
Started.
----------
Traceback (most recent call last):
File "/home/robot/First_EV3_Program/MotorTestv1f.py", line 15, in <module>
NameError: name 'Print' is not defined
I'm fairly new to this and attempting to get this up and running for my son, so he can take over
names in python are case-sensitive, so it is telling you that Print
is not defined.
This should work:
print("Motor Test Start")
Thank you, I should know better, my humble thank you.
On January 25, 2020 at 1:01 AM David Lechner notifications@github.com wrote:
names in python are case-sensitive, so it is telling you that Print is not defined. This should work: print("Motor Test Start") — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ev3dev/vscode-ev3dev-browser/issues/92?email_source=notifications&email_token=AOJIR3OASY32ZVG4QAHAYFLQ7PITPA5CNFSM4KEY37CKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJ4WETQ#issuecomment-578380366 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AOJIR3NGNR6SNWASU2HGK3TQ7PITPANCNFSM4KEY37CA .
Hi There,
could someone help me to fix this problem?
I tried all the suggested solutions out there. It doesn't work properly.
This is the Code:
This is the error: