Jump to content

Recommended Posts

Posted

Hi all, first post here. Made this using Pybricks, it's pretty straightforward but there is a neat little mechanism in there with two differentials that allows the vehicle to roll freely independent of the motor.

Also programmed it so that the vehicle tilts depending on the speed and the steering angle. Because of the space the three motors and the hub take up, I didn't really have space for a passenger seat. Let me know what you think!
 

  

while Button.B not in controller.buttons.pressed():
    power = controller.triggers()[1] - controller.triggers()[0]
    steer_percentage = controller.joystick_left()[0]

    steer_percentage = 0 if abs(steer_percentage) < 5 else steer_percentage

    car.drive_power(power)
    car.steer(steer_percentage)

    if Button.LB in controller.buttons.pressed():
        tilted_car.steer(-100)
    elif Button.RB in controller.buttons.pressed():
        tilted_car.steer(100)
    else:
        tilted_car.steer(100 * (steer_percentage / 100) * (power / 100))

    wait(10)

 

 

IMG_1546.jpg

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...