User Manual

33
Driving Motor
1 In the palette area, click to select the PiSmart category.
2
Then click and drag into the scripting area.
3 Enter values in the slot:
In this block, there are two parameters for control: channel and speed.
For the left one, channel is to set the motor you want to control. Click the input of
direction by the triangle sign and select a value at the drop-down list. Click A, meaning
you'll control the motor at MotorA. Then click the right-side parameter, speed: enter a
number ranging between -0 and 100. The larger value you enter, the faster the motor
spins. Positive or negative value indicates the motor turns clockwise or counter-CW. So
now your block defines the motor, its speed and the rotational direction.
4 Click this block and see what will happen to the MotorA. Yes! MotorA starts to spin.
Then for two ports, MotorA and MotorB, you can select the channel both in the block, so two
channels output values at the same time, thus controlling both motor A and B at one time.
For example, click both on the list and enter 60 in the speed, meaning outputting a speed of
SunFounder