FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    How to control DC motor with Raspberry Pivot and L298 motor drive

     

    What is the L298? L298 is called bidirectional motor driver, which is based on a dual H-bridge motor driver IC. This circuit allows you to individually control two DC motors in either direction. It is a common component prototypes and projects fans, because it is easy to use, and may be connected to the L298 Raspberry Pi or Arduino. In addition to the minimum design, it also provides 5V regulator board, can easily 5V to power the circuit. There are many on the market based on the L298 motor driver module, you can use any locally available based on the motor drive L298, as they are basically the same. I used the L298 breakout board, which makes it easier to set up. You can find several different L298 breakout board online. The L298 is connected to the Raspberry Pi Raspberry Pi control using a DC motor can be easily achieved. We use L298 motor driver to control the DC motor, which allows the motor to move forward or backward. For communication, we will use a simple USB cable via serial communication. So, let's get started. The IN1 is connected to the L298 pin 26 Raspberry Pi. IN2 L298 is connected to pin number 20 Raspberry Pi. ENA and connecting pins 12 volt to 9 volt battery. Make sure the battery ground, Raspberry Pi and L298 are common. Run the program and code Open Raspberry Pi Python 3 and open in a new window .. Write the following code in the new window and save it on your desktop. Import sys import time import RPi.GPIO as GPIO mode = GPIO.getmode () GPIO.cleanup () Forward = 26 Backward = 20 sleeptime = 1 GPIO.setmode (GPIO.BOARD) GPIO.setup (Forward, GPIO.OUT) GPIO.setup (Backward, GPIO.OUT) def forward (x): GPIO.output (Forward, GPIO.HIGH) print ( "Moving Forward") time.sleep (x) GPIO.output (Forward, GPIO.LOW) def reverse (x): GPIO.output (Backward, GPIO.HIGH) print ( "Moving Backward") time.sleep (x) GPIO.output (Backward, GPIO.LOW) while (1): forward (5) reverse (5) GPIO.cleanup () Make sure the Raspberry Pi L298N connected, as shown in the circuit diagram above. Then, run the code you just wrote. Code Description L298 library required in the above example, the code G from the introduction system comprises a start time and PIO. Notably, GPIO to provide high and low logic L298, time libraries for adding a delay between the different actions. Forward and reverse function parameter declarations in this code with the option. Parameter is a delay time maintaining the motor in a desired direction. It is the way you should be able to control the motor with the Raspberry Pi and L298 motor driver. You can find more code online variants to add additional functionality to the motor! Read more

     

     

     

     

    List all Question

    Nickname

    Email

    Questions

    Our other product:

    Professional FM Radio Station Equipment Package

     



     

    Hotel IPTV Solution

     


      Enter email  to get a surprise

      fmuser.org

      es.fmuser.org
      it.fmuser.org
      fr.fmuser.org
      de.fmuser.org
      af.fmuser.org ->Afrikaans
      sq.fmuser.org ->Albanian
      ar.fmuser.org ->Arabic
      hy.fmuser.org ->Armenian
      az.fmuser.org ->Azerbaijani
      eu.fmuser.org ->Basque
      be.fmuser.org ->Belarusian
      bg.fmuser.org ->Bulgarian
      ca.fmuser.org ->Catalan
      zh-CN.fmuser.org ->Chinese (Simplified)
      zh-TW.fmuser.org ->Chinese (Traditional)
      hr.fmuser.org ->Croatian
      cs.fmuser.org ->Czech
      da.fmuser.org ->Danish
      nl.fmuser.org ->Dutch
      et.fmuser.org ->Estonian
      tl.fmuser.org ->Filipino
      fi.fmuser.org ->Finnish
      fr.fmuser.org ->French
      gl.fmuser.org ->Galician
      ka.fmuser.org ->Georgian
      de.fmuser.org ->German
      el.fmuser.org ->Greek
      ht.fmuser.org ->Haitian Creole
      iw.fmuser.org ->Hebrew
      hi.fmuser.org ->Hindi
      hu.fmuser.org ->Hungarian
      is.fmuser.org ->Icelandic
      id.fmuser.org ->Indonesian
      ga.fmuser.org ->Irish
      it.fmuser.org ->Italian
      ja.fmuser.org ->Japanese
      ko.fmuser.org ->Korean
      lv.fmuser.org ->Latvian
      lt.fmuser.org ->Lithuanian
      mk.fmuser.org ->Macedonian
      ms.fmuser.org ->Malay
      mt.fmuser.org ->Maltese
      no.fmuser.org ->Norwegian
      fa.fmuser.org ->Persian
      pl.fmuser.org ->Polish
      pt.fmuser.org ->Portuguese
      ro.fmuser.org ->Romanian
      ru.fmuser.org ->Russian
      sr.fmuser.org ->Serbian
      sk.fmuser.org ->Slovak
      sl.fmuser.org ->Slovenian
      es.fmuser.org ->Spanish
      sw.fmuser.org ->Swahili
      sv.fmuser.org ->Swedish
      th.fmuser.org ->Thai
      tr.fmuser.org ->Turkish
      uk.fmuser.org ->Ukrainian
      ur.fmuser.org ->Urdu
      vi.fmuser.org ->Vietnamese
      cy.fmuser.org ->Welsh
      yi.fmuser.org ->Yiddish

       
  •  

    FMUSER Wirless Transmit Video And Audio More Easier !

  • Contact

    Address:
    No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620

    E-mail:
    [email protected]

    Tel / WhatApps:
    +8618078869184

  • Categories

  • Newsletter

    FIRST OR FULL NAME

    E-mail

  • paypal solution  Western UnionBank OF China
    E-mail:[email protected]   WhatsApp:+8618078869184   Skype:sky198710021 Chat with me
    Copyright 2006-2020 Powered By www.fmuser.org

    Contact Us