# Spark Mini

When you do not have any motor ports left on your robot, Spark minis are a great way to control your motor.

{% hint style="info" %}
You can not use encoders with Spark Minis
{% endhint %}

### Wiring:

{% embed url="<https://cdn11.bigcommerce.com/s-t3eo8vwp22/images/stencil/1280x1280/products/339/2708/Spark_Mini_Illustraion-noflag__67593.1650558658.png?c=2>" %}

{% hint style="info" %}
Spark Minis get plugged into the servo port. In your configuration go to the servo menu and select Spark Mini.
{% endhint %}

### Code:

```
@TeleOp 
public class SparkMiniExample extends LinearOpMode {
    DcMotorSimple motor;
    
    @Override
    public void runOpMode() {
    
        motor = hardwareMap.get(DcMotorSimple.class, "motor");
    
        // Wait for the game to start (driver presses PLAY)
        waitForStart();
    
        // run until the end of the match (driver presses STOP)
        while (opModeIsActive()) {
            motor.setPower(gamepad1.left_stick_y);
        }
    }
}
```

{% hint style="info" %}
Spark Minis use the `DcMotorSimple` class while a regular DcMotor uses uses the `DcMotor` class.&#x20;
{% endhint %}
