Jump to content
THIS IS THE TEST SITE OF EUROBRICKS! ×
THIS IS THE TEST SITE OF EUROBRICKS!

Recommended Posts

Posted (edited)
For all the C+ nerds out there, here is a quick demo for using the PoweredUp remote directly with the Control+ Technic Hub using PyBricks. This is the code I'm running on my motorised 42110 Land Rover but can be used with any model using 2 drive motors and 1 steering motor like the 42099 4X4 X-treme Off-Roader set.

The code has two control modes:
Bang Bang mode simply acts as an on/off controller similer to how the PowerFunctions remote worked in that it turns the drive motors on while the button is pressed and then turns them off when button is released, The steering motor also goes to full lock while the button is pressed and returns to centre when released.

Precision Mode acts as a speed controller for the drive motors and provides 10 speed steps in either direction and increments to steering motor by 10° on each button press to give 8 angle steps.

The red stop buttons act as emergency stop buttons and the green centre button is the control mode select.

I have published the code to my Github account should you wish to download it and try it for yourself.
Please make sure you configure the "User Definable Setting" and the " Initialize Motors" sections to suit your needs before running the code.
 

This code is released under the MIT licence, so feel free to download, use, edit and share this code under the terms of the MIT licence, full licence details included in the repo.
Edited by MxWinters
Spelling
Posted (edited)

Thanks for sharing, really interesting. Also your code is valuable, clear and well documented!

Edited by GerritvdG
Posted
On 7/6/2022 at 8:56 PM, GerritvdG said:

Thanks for sharing, really interesting. Also your code is valuable, clear and well documented!

 

On 7/6/2022 at 9:18 PM, Lok24 said:

Nice, thanks for sharing

Thanks alot, glad you like it. I hope it proves useful to someone.

Any issue with it, let me know and Ill take a look. Feel free to fork and submit a pull request if you come up with something that you think should be added/changed.

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...