1. motor driver[index] outputs power [power] % for [time] secs

DC Motor Driver - 图1

Makes the specified motor driver output the specified power for the specified period of time

How to Use

The number in this block indicates the place of a motor driver among the ones connected to Halocode. As shown in the following figure, the number 1 indicates the first motor driver connected to Halocode, 2 indicates the second one, and so on.
DC Motor Driver - 图2
Click to set the power and time.
Setting range of the power: –100 to +100, where a negative value indicates reverse running
Note: When you use the motor driver to drive a water pump, set the output power to a positive value. Otherwise, the water pump can’t work properly.

Example

DC Motor Driver - 图3

When you press the space key, the first motor driver connected to Halocode outputs the power of 50% for one second.
Note: Connect a motor to the motor driver when you use this block. You can see the motor rotate when you press the space key.


2. motor driver [index] outputs power [power] %

DC Motor Driver - 图4

Makes the specified motor driver output the specified power

How to Use

Click to set the power and time.
Setting range of the power: –100 to +100, where a negative value indicates reverse running
Note: When you use the motor driver to drive a water pump, set the output power to a positive value. Otherwise, the water pump can’t work properly.

Example

DC Motor Driver - 图5

When you press the space key, the first motor driver connected to Halocode outputs the power of 50%.
Note: Connect a motor to the motor driver when you use this block. You can see the motor rotate when you press the space key.


3. motor driver [index] increases power output by [power] %

DC Motor Driver - 图6

Increases the power output of the specified motor driver by the specified percentage

How to Use

Click to set the percentage by which the power to be increased.
Setting range of the power: –100 to +100, where a negative value indicates reverse running
Note: When you use the motor driver to drive a water pump, ensure that the output power is greater than zero. Otherwise, the water pump can’t work properly.

Example

DC Motor Driver - 图7

When you press the space key, the power output of the the first motor driver connected to Halocode is increased by 20%.
Note: Connect a motor to the motor driver when you use this block. You can see the motor rotate faster when you press the space key.


4. motor driver[index] stops power output

DC Motor Driver - 图8

Stops the power output of the specified motor driver

Example

DC Motor Driver - 图9

When you press the space key, the first motor driver connected to Halocode outputs the power of 50% and stops the power output after five seconds.
Note: Connect a motor to the motor driver when you use this block. You can see the motor rotate for five seconds after you press the space key.


5. all motor drivers stop power output

DC Motor Driver - 图10

Stops the power output of all the motor drivers

Example

DC Motor Driver - 图11

When you press the space key, all the motor drivers connected to Halocode stop the output of power.
Note: Connect a motor to a motor driver when you use this block. You can see the motor stop rotating after you press the space key.


6. motor driver [index] output level(%)

DC Motor Driver - 图12

Reports the power output of the specified motor driver

How to Use

You can select the check box on the left of this block to view the power output of the specified motor driver on the stage.
Note: This is a reporter block that must be used in combination with another block requiring data.

Example

DC Motor Driver - 图13

When you press the space key, the first LED matrix connected to Halocode displays the power output of the first motor driver.
Note: Ensure that you have connected an LED matrix to Halocode.