How to fix MC33926 Dual Motor Driver for Raspberry Pi?












0















I recently purchased my MC33926 Dual Motor Driver for Raspberry Pi, wired it up to some motors, completed the code and found nothing to happen. I've consulted the schematics to ensure my wiring isn't off and I'm using the right pins and scanned the internet for example code to follow from. Unfortunately, the best I could find was in French so that was slightly irritating.



Ultimately, this is the code I came up with that should have caused one of the motors to turn:



import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BCM)
#set GPIO pins
m1PWM = 12;
m1EN = 22;
m1DIR = 24;

#set GPIO direction (IN / OUT)
GPIO.setup(m1PWM, GPIO.OUT)
GPIO.setup(m1EN, GPIO.OUT)
GPIO.setup(m1DIR, GPIO.OUT)

#ENABLE MOTOR 1
GPIO.output(m1EN, True)

#SET DIRECTION
GPIO.output(m1DIR, True)

#PWD to set acceleration level
p = GPIO.PWM(m1PWM, 10000)
p.start(10)


Is there a problem with my code that is causing it to not run the motors as I would have expected? Why am I encountering these errors?



To save your time, I have some links you might find helpful:



https://www.pololu.com/product/2755/resources



https://www.pololu.com/product/2755



https://sourceforge.net/p/raspberry-gpio-python/wiki/PWM/



https://www.quora.com/What-is-the-difference-between-duty-cycle-and-frequency



https://forum.pololu.com/t/dual-mc33926-motor-driver-carrier-on-raspberry-pi-3/12419/3










share|improve this question



























    0















    I recently purchased my MC33926 Dual Motor Driver for Raspberry Pi, wired it up to some motors, completed the code and found nothing to happen. I've consulted the schematics to ensure my wiring isn't off and I'm using the right pins and scanned the internet for example code to follow from. Unfortunately, the best I could find was in French so that was slightly irritating.



    Ultimately, this is the code I came up with that should have caused one of the motors to turn:



    import RPi.GPIO as GPIO

    GPIO.setmode(GPIO.BCM)
    #set GPIO pins
    m1PWM = 12;
    m1EN = 22;
    m1DIR = 24;

    #set GPIO direction (IN / OUT)
    GPIO.setup(m1PWM, GPIO.OUT)
    GPIO.setup(m1EN, GPIO.OUT)
    GPIO.setup(m1DIR, GPIO.OUT)

    #ENABLE MOTOR 1
    GPIO.output(m1EN, True)

    #SET DIRECTION
    GPIO.output(m1DIR, True)

    #PWD to set acceleration level
    p = GPIO.PWM(m1PWM, 10000)
    p.start(10)


    Is there a problem with my code that is causing it to not run the motors as I would have expected? Why am I encountering these errors?



    To save your time, I have some links you might find helpful:



    https://www.pololu.com/product/2755/resources



    https://www.pololu.com/product/2755



    https://sourceforge.net/p/raspberry-gpio-python/wiki/PWM/



    https://www.quora.com/What-is-the-difference-between-duty-cycle-and-frequency



    https://forum.pololu.com/t/dual-mc33926-motor-driver-carrier-on-raspberry-pi-3/12419/3










    share|improve this question

























      0












      0








      0








      I recently purchased my MC33926 Dual Motor Driver for Raspberry Pi, wired it up to some motors, completed the code and found nothing to happen. I've consulted the schematics to ensure my wiring isn't off and I'm using the right pins and scanned the internet for example code to follow from. Unfortunately, the best I could find was in French so that was slightly irritating.



      Ultimately, this is the code I came up with that should have caused one of the motors to turn:



      import RPi.GPIO as GPIO

      GPIO.setmode(GPIO.BCM)
      #set GPIO pins
      m1PWM = 12;
      m1EN = 22;
      m1DIR = 24;

      #set GPIO direction (IN / OUT)
      GPIO.setup(m1PWM, GPIO.OUT)
      GPIO.setup(m1EN, GPIO.OUT)
      GPIO.setup(m1DIR, GPIO.OUT)

      #ENABLE MOTOR 1
      GPIO.output(m1EN, True)

      #SET DIRECTION
      GPIO.output(m1DIR, True)

      #PWD to set acceleration level
      p = GPIO.PWM(m1PWM, 10000)
      p.start(10)


      Is there a problem with my code that is causing it to not run the motors as I would have expected? Why am I encountering these errors?



      To save your time, I have some links you might find helpful:



      https://www.pololu.com/product/2755/resources



      https://www.pololu.com/product/2755



      https://sourceforge.net/p/raspberry-gpio-python/wiki/PWM/



      https://www.quora.com/What-is-the-difference-between-duty-cycle-and-frequency



      https://forum.pololu.com/t/dual-mc33926-motor-driver-carrier-on-raspberry-pi-3/12419/3










      share|improve this question














      I recently purchased my MC33926 Dual Motor Driver for Raspberry Pi, wired it up to some motors, completed the code and found nothing to happen. I've consulted the schematics to ensure my wiring isn't off and I'm using the right pins and scanned the internet for example code to follow from. Unfortunately, the best I could find was in French so that was slightly irritating.



      Ultimately, this is the code I came up with that should have caused one of the motors to turn:



      import RPi.GPIO as GPIO

      GPIO.setmode(GPIO.BCM)
      #set GPIO pins
      m1PWM = 12;
      m1EN = 22;
      m1DIR = 24;

      #set GPIO direction (IN / OUT)
      GPIO.setup(m1PWM, GPIO.OUT)
      GPIO.setup(m1EN, GPIO.OUT)
      GPIO.setup(m1DIR, GPIO.OUT)

      #ENABLE MOTOR 1
      GPIO.output(m1EN, True)

      #SET DIRECTION
      GPIO.output(m1DIR, True)

      #PWD to set acceleration level
      p = GPIO.PWM(m1PWM, 10000)
      p.start(10)


      Is there a problem with my code that is causing it to not run the motors as I would have expected? Why am I encountering these errors?



      To save your time, I have some links you might find helpful:



      https://www.pololu.com/product/2755/resources



      https://www.pololu.com/product/2755



      https://sourceforge.net/p/raspberry-gpio-python/wiki/PWM/



      https://www.quora.com/What-is-the-difference-between-duty-cycle-and-frequency



      https://forum.pololu.com/t/dual-mc33926-motor-driver-carrier-on-raspberry-pi-3/12419/3







      linux python






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 21 at 7:23









      Megan FoxMegan Fox

      11




      11






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1396501%2fhow-to-fix-mc33926-dual-motor-driver-for-raspberry-pi%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1396501%2fhow-to-fix-mc33926-dual-motor-driver-for-raspberry-pi%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Plaza Victoria

          Puebla de Zaragoza

          Musa