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

Featured Replies

Posted

My current project uses "run_to_position(0, direction='shortest path')" to set two motors to a known position before the rest of the code runs. However, this doesn't always work. If I run another of my creations, usually by mistake, before running my current project the motors can end up in some odd position and running code that begins with "run_to_position(0, direction='shortest path')" does not correct the situation.

I can correct this either by switching the hub off and then back on and select the correct programme or run the Charlie scratch version provided by Lego. The scratch code contains a "calibration block". I'm attempting to simulate that block by running "run_to_position(0, direction='shortest path')". It seems that the block contains more that run_to_position and that I need a piece of Python code that is the equivalent of the "calibration block. Can anyone offer any suggestions?

 

Edited by Dragon50
Spelling error

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

Recently Browsing 0

  • No registered users viewing this page.
Sponsored Links