# What motor library to use

**URL:** <https://forum.xod.io/t/what-motor-library-to-use/1931>\
**Category:** Uncategorized\
**Created:** [March 1, 2019, 9:45pm UTC](https://forum.xod.io/t/what-motor-library-to-use/1931 "2019-03-01T21:45:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhall](https://avatars.discourse-cdn.com/v4/letter/d/3e96dc/32.png) [@dhall](https://forum.xod.io/u/dhall)\
**Post date:** [March 1, 2019, 9:46pm UTC](https://forum.xod.io/t/what-motor-library-to-use/1931/1 "2019-03-01T21:46:00Z")

</div>

What library would you use for this motor shield? Having issues with things working intermittently.

[https://www.amazon.com/HiLetgo-Driver-Shield-Compatible-Duemilanove/dp/B01DG61YRM/ref=sr\_1\_7?keywords=arduino+motor+shield&qid=1551475809&s=gateway&sr=8-7](https://www.amazon.com/HiLetgo-Driver-Shield-Compatible-Duemilanove/dp/B01DG61YRM/ref=sr_1_7?keywords=arduino+motor+shield&qid=1551475809&s=gateway&sr=8-7)

Thank you

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [March 1, 2019, 10:31pm UTC](https://forum.xod.io/t/what-motor-library-to-use/1931/2 "2019-03-01T22:31:48Z")

</div>

Looks like h-bridge node should work. Do you have only one h-bridge node for each motor (set of pins) in your patch? If you have multiple nodes for a single motor (or include the patch that has the h-bridge node multiple times), you will have issues unless you gate the input to the PWM pin; otherwise the controller will get conflicting values from multiple locations.

Probably the simplest test if h-bridge works is to create a new patch that just has a POT and h-bridge. Feed POT output to PWM of h-bridge and add appropriate values for port #s on both nodes. Moving POT should change speed of motor.

If the simple test above works, but your code doesn’t, we would need to see your code to help determine what might be the problem.

---

<div class="post-metadata">

**Author:** ![dirkhallsz](https://avatars.discourse-cdn.com/v4/letter/d/e495f1/32.png) [@dirkhallsz](https://forum.xod.io/u/dirkhallsz)\
**Post date:** [March 3, 2019, 11:14pm UTC](https://forum.xod.io/t/what-motor-library-to-use/1931/3 "2019-03-03T23:14:16Z")

</div>

Thanks for the help, but not sure how to set this up. What would the patch look like. I have no idea how to get this done. Obviously very new to this.

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [March 4, 2019, 12:19am UTC](https://forum.xod.io/t/what-motor-library-to-use/1931/4 "2019-03-04T00:19:27Z")

</div>

It would look very much like POT connected to LED in the built in tutorial. You will want to go through that to get a basic understanding of XOD.

---

<div class="post-metadata">

**Author:** ![dirkhallsz](https://avatars.discourse-cdn.com/v4/letter/d/e495f1/32.png) [@dirkhallsz](https://forum.xod.io/u/dirkhallsz)\
**Post date:** [March 4, 2019, 1:29am UTC](https://forum.xod.io/t/what-motor-library-to-use/1931/5 "2019-03-04T01:29:31Z")

</div>

I don’t have a pot to try the test. But what i have tried is this the LED works as expected but the motor doesn’t work all the time it may work 2-3 times the nothing at all and also can’t adjust speed. ![ir%20test](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/42f3660234d8e4b0e70d7cdba0fbb38830d00533.svg)

---

<div class="post-metadata">

**Author:** ![dirkhallsz](https://avatars.discourse-cdn.com/v4/letter/d/e495f1/32.png) [@dirkhallsz](https://forum.xod.io/u/dirkhallsz)\
**Post date:** [March 4, 2019, 1:44am UTC](https://forum.xod.io/t/what-motor-library-to-use/1931/6 "2019-03-04T01:44:59Z")

</div>

![ir%20test](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/42f3660234d8e4b0e70d7cdba0fbb38830d00533.svg)

Tried to post picture of patch but does not upload

---

<div class="post-metadata">

**Author:** ![dhall](https://avatars.discourse-cdn.com/v4/letter/d/3e96dc/32.png) [@dhall](https://forum.xod.io/u/dhall)\
**Post date:** [March 5, 2019, 9:04pm UTC](https://forum.xod.io/t/what-motor-library-to-use/1931/7 "2019-03-05T21:04:23Z")

</div>

does not work with a pot and can’t upload picture??

---

<div class="post-metadata">

**Author:** ![nkrkv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/nkrkv/32/8_2.png) [@nkrkv](https://forum.xod.io/u/nkrkv)\
**Post date:** [March 11, 2019, 12:47pm UTC](https://forum.xod.io/t/what-motor-library-to-use/1931/8 "2019-03-11T12:47:23Z")

</div>

This is Adafruit Motor Shield v1 replica. Its H-Bridges are behind a shift register. Use [https://xod.io/libs/nkrkv/af-motor/](https://xod.io/libs/nkrkv/af-motor/) to drive it, I’ve made this library specifically for this type of shields.
