Announcement

Collapse
No announcement yet.

Ev3 Python simple line of code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ev3 Python simple line of code

    #!/usr/bin/env python3
    from ev3dev2.motor import LargeMotor, OUTPUT_B
    from ev3dev2.motor import SpeedDPS, SpeedRPS, Spee dRPM
    large_motor = LargeMotor(OUTPUT_B)
    #This line below supposed to make motor B run forever.
    large_motor.on(speed=40)

    Any ideas why it only runs for 1 second then stop. I try to learn something new and this line got me stuck!!!
    large_motor.on(speed=40)

  • #2
    Because you are doing nothing to stop the program from ending. When a program finishes all the instructions it ends. When a program ends it turns off the motors.

    Comment

    Working...
    X