Skip to content

Control the Smart Cart Motor power

Control the speed and direction of a Smart Cart Motor attached to a Smart Cart.

Access the Control Panel

  1. Connect the Smart Cart Motor to a Smart Cart.
  2. Connect the Smart Cart to SPARKvue.
  3. Build a new experiment page and select any layout.
  4. Select the Smart Cart Motor Display Smart Motor Display.

Turn the motor on or off

Do either of the following to turn the motor on or off:

  • Click the On or Off buttons.
  • Select the Auto checkbox. When the box is checked, the motor automatically turns on when collecting data and turns off when data collection stops.

Set the speed and direction

Do either of the following to set the speed and direction of the motor:

  • Enter a value between -100 and +100 in the Power field.
  • Click and drag the Power slider between -100 and +100.

Create a program

Create a program to control the Smart Cart Motor using the Code tool. Access the following two blocks in the Hardware group:

  • On/Off Block

    Use this block to turn the motor on or off. Set the parameter to true to turn on the motor, or set it to false to turn off the motor. Use a block in the Logic group in place of the true/false block to create a logical expression to turn the motor on or off.

  • Power Block

    Use this block to set the power of the Smart Cart Motor between -100 and +100. You can either use the default number block to set the power or replace this block with a block from the Math group.