# Digital GPIO mapping to do start/stop function

**URL:** <https://discourse.odriverobotics.com/t/digital-gpio-mapping-to-do-start-stop-function/11251>\
**Category:** Support\
**Created:** [February 22, 2024, 8:46pm UTC](https://discourse.odriverobotics.com/t/digital-gpio-mapping-to-do-start-stop-function/11251 "2024-02-22T20:46:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AReallyGoodGuy](https://discourse.odriverobotics.com/letter_avatar_proxy/v4/letter/a/47e85d/32.png) [@AReallyGoodGuy](https://discourse.odriverobotics.com/u/AReallyGoodGuy)\
**Post date:** [February 22, 2024, 8:46pm UTC](https://discourse.odriverobotics.com/t/digital-gpio-mapping-to-do-start-stop-function/11251/1 "2024-02-22T20:46:31Z")

</div>

I am trying to find a way to map one of the GPIO pins to start the motor when it receives a 5V signal and stop when it doesn’t. Additionally, I could map another GPIO pin to send a stop signal.

I am currently using firmware version 0.5.6. I have programmed the Odrive to operate in the AXIS\_STATE\_CLOSED\_LOOP\_CONTROL state using the hall encoder in CONTROL\_MODE\_VELOCITY\_CONTROL.

Despite its simplicity, I can’t seem to find any related topics or solutions to this problem.

---

<div class="post-metadata">

**Author:** ![solomondg](https://discourse.odriverobotics.com/letter_avatar_proxy/v4/letter/s/bcef8e/32.png) [@solomondg](https://discourse.odriverobotics.com/u/solomondg)\
**Post date:** [February 23, 2024, 2:19pm UTC](https://discourse.odriverobotics.com/t/digital-gpio-mapping-to-do-start-stop-function/11251/2 "2024-02-23T14:19:54Z")

</div>

Hi there,

Enable pin isn’t supported on v3.6, just S1/Pro. You could modify the firmware to add support, or add a small external microcontroller to control the ODrive over UART from its own GPIO pins.

Alternatively, if it’s okay for the motor to always be enabled (e.g. holding zero speed when the motor’s stopped, versus just idling/freewheeling) you could use analog inputs as a mapping to velocity setpoints.

---

<div class="post-metadata">

**Author:** ![AReallyGoodGuy](https://discourse.odriverobotics.com/letter_avatar_proxy/v4/letter/a/47e85d/32.png) [@AReallyGoodGuy](https://discourse.odriverobotics.com/u/AReallyGoodGuy)\
**Post date:** [February 23, 2024, 2:33pm UTC](https://discourse.odriverobotics.com/t/digital-gpio-mapping-to-do-start-stop-function/11251/3 "2024-02-23T14:33:50Z")

</div>

I was considering sending a 0% or 100% PWM signal to the controller, but mapping an analog input could also achieve the desired outcome.

As I’m new to the DIY world, I’m not yet confident in my ability to program a UART to control the Odrive. While I could learn, it might be best to keep the control solely within the Odrive.

I’ll explore this further. Thank you for your assistance.

---

<div class="post-metadata">

**Author:** ![solomondg](https://discourse.odriverobotics.com/letter_avatar_proxy/v4/letter/s/bcef8e/32.png) [@solomondg](https://discourse.odriverobotics.com/u/solomondg)\
**Post date:** [February 23, 2024, 6:24pm UTC](https://discourse.odriverobotics.com/t/digital-gpio-mapping-to-do-start-stop-function/11251/4 "2024-02-23T18:24:48Z")

</div>

Sure, that should work. PWM is definitely more robust than analog, though the UART should also be pretty straightforward with an Arduino.
