Each Motor Driver block has the ability to drive up to 4 Brushed Motors at the same time with each having the following configurable elements:
- SetSpeed: Reads incoming values between 0 and 100, and sets the speed of the brushed motor as a percentage.
- Brake: Incoming events trigger a hard stop.
- Coast: Incoming events trigger a power cut to the brushed motor, allowing the motor to coast to a stop.
In this article, you will learn how to configure the block’s outputs from the properties panel and how to use a basic combination of gates to get your motor moving.
1. Connect your Motor Driver to the WiFi and Power Station blocks:
2. Connect your brushed motor to one of the block’s outputs. Make sure the shiny bits in the connector are facing up as shown below:
3. Click on the Quick Menu in the bottom right. Add the Motor Driver Block into the canvas by clicking on the menu icon:
4. From the block’s Properties Panel, click on to ‘Custom Settings’ and locate the ‘Motors Configuration’ section, from here you can define the operation mode of each of the 4 outputs. Keep in mind that the labels on the left (Motor-X) refer to the numbers on top of the physical Motor Driver Block. So, if you connected your brushed motor to position 2, make sure that from the dropdown button corresponding to that output you select ‘Brushed’. Once you change the correct output, press ‘Save’.
5. Go to the Motor Driver’s Logic Maker, add and connect the following gates:
PLAY -> VALUE -> ACTION
6. From the ACTION Gate’s list, select ‘M2:SetSpeed’ (note that if you connected your motor to a different port, the action name should be that of the chosen output) and click on ‘Apply’ to save your changes. Press the PLAY Gate button, the brushed motor should spin.