![]() The move _ motor _ at _ % block is the basis of the moto:bit software package. A good practice is to turn them OFF when your robot completes its task or should not be moving for long periods of time, this saves batteries and wasted power consumption. They are naturally OFF, so anytime you want to drive motors, you need to set them to ON. The turn motors _ block gives you the ability to turn the motors ON or OFF in software. When it gets to the end of the program it will stop again until you press the A button again. In this block, when the A button is pressed on your micro:bit your robot will start moving. ![]() Any code blocks that are placed inside of the block will only execute when that event happens. The on button _ pressed code block is an event function. If you want the motor to drive in the opposite direction relative to your setup, select either true or false. Set the left or right motor that you would like to invert. The set _ motor invert to _ provides the option to switch the motor wires in code without physically rewiring the motors to the moto:bit. Depending on how the motors are wired to the moto:bit, your micro:bot may drive in the opposite direction than what you would expect. ![]() The code starts by setting each motor channel in the on start code block. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |