# Possible bug in Dual VNH5019 Motor Driver Shield Library

**URL:** https://forum.pololu.com/t/possible-bug-in-dual-vnh5019-motor-driver-shield-library/7203
**Category:** Motor controllers/drivers and motors
**Created:** [June 18, 2014, 3:52pm UTC](https://forum.pololu.com/t/possible-bug-in-dual-vnh5019-motor-driver-shield-library/7203 "2014-06-18T15:52:07Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![JeremyT](https://forum.pololu.com/user_avatar/forum.pololu.com/jeremyt/32/540_2.png) [@JeremyT](https://forum.pololu.com/u/JeremyT)
#### Post date: [June 19, 2014, 7:54pm UTC](https://forum.pololu.com/t/possible-bug-in-dual-vnh5019-motor-driver-shield-library/7203/2 "2014-06-19T19:54:29Z")

</div>

Hello, Fowler.

> [@rbfowler9](#):
>
> ```auto
> analogWrite(9, 254);
> delay(1000);  
> analogWrite(9, 255);
> delay(1000);  
> analogWrite(9, 256);
> delay(1000);
> ```
> 
> the resulting square waves have duty cycles of ~63%, 100% and ~64% respectively.

I tried using an Arduino Mega and our VNH5019 shield with the dual-vnh5019-motor-shield library and did not get the same results you did. For analogWrite(9, 254), I observed a PWM signal with 99.6% duty cycle at 980 Hz, and analogWrite(9, 256) did not produce a signal. What were you measuring when you got those results? If you have not already, could you try running the code above without including our library and see if you still observe the same signals on pin 9?

By the way, you can find a modified version of the VNH5019 shield library for the Arduino Mega that drive motors with a 20 kHz PWM in [this thread](https://forum.pololu.com/t/modified-vnh5019-shield-library-for-20khz-pwm-with-mega/5178/1).

- Jeremy

---

_[View the full topic](https://forum.pololu.com/t/possible-bug-in-dual-vnh5019-motor-driver-shield-library/7203)._
