> For the complete documentation index, see [llms.txt](https://sryvkver.gitbook.io/cobi.bike/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sryvkver.gitbook.io/cobi.bike/namespaces/motor/drive-mode.md).

# 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 %}
