# Drive mode

Defines the eBike drive mode of the specific vendor protocol.

In ascending order. Depending on the Supported Drive Modes

{% tabs %}
{% tab title="Typescript" %}

```typescript
const onDriveModeChange = (value: number, timestamp?: Date) => {
    console.log(value, timestamp);
};

COBI.motor.driveMode.read(onDriveModeChange); // Instantly get the current value
COBI.motor.driveMode.subscribe(onDriveModeChange);
COBI.motor.driveMode.unsubscribe(onDriveModeChange);
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
const onDriveModeChange = (value, timestamp) => {
    console.log(value, timestamp);
};

COBI.motor.driveMode.read(onDriveModeChange); // Instantly get the current value
COBI.motor.driveMode.subscribe(onDriveModeChange);
COBI.motor.driveMode.unsubscribe(onDriveModeChange);
```

{% endtab %}
{% endtabs %}
