FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    Talking about the positive and reverse rotation and PWM speed regulation based on H-bridge circuitry

     

    Take a H-bridge circuit, control the positive and reverse rotation of the motor, the program is online, the change pin can be used, the circuit and source procedures are as follows: Function: P1.1 button stop, P1.2 left, P1.3 Right Turn, P1.0 speed control #include #define uchar unsigned char #define uint unsigned int SBIT PW1 = P0 ^ 0; SBIT PW2 = P0 ^ 1; / / Controlling two inputs of the motor Sbit accelerate = p1 ^ 0; // speed control button SBIT STOP = P1 ^ 1; // Stop button SBIT LEFT = P1 ^ 2; // Left rotary button SBIT Right = P1 ^ 3; // Right turn button #define right_turn PW1 = 0; PW2 = 1 // Clock-clock rotation #define left_turn PW1 = 1; PW2 = 0 // Reverse rotation #define end_turn pw1 = 1; PW2 = 1 // Stop uint t0 = 25000, t1 = 25000; // initially duty cycle is 50% UINT A = 25000; // Set the timer load initial value 25ms set frequency is 20 Hz Uchar flag = 1; // This flag is used to select different loading initial values Uchar dflag; // left and right rotation mark Uchar count; // Used to mark speed gear Void keyScan (); // Keyboard scan Void delay (uchar z); Void Time_init (); // Timer Initialization Void Adjust_Speed ​​(); // Adjust the speed by adjusting the duty ratio // ***************************************** // void main () { Time_init (); // initialization of timer While (1) { Keyscan (); // Constantly scan the keyboard program to make a corresponding response in time } } // ************************************ // Void Timer0 () Interrupt 1 Using 0 { IF (Flag) { FLAG = 0; END_TURN; A = T0; // T0 size determines low levels of continuation time TH0 = (65536-a) / 256; TL0 = (65536-a)% 256; // Rear load initial value } Else { FLAG = 1; // This logo functions to alternately output high and low level IF (dflag == 0) { Right_Turn; // Right Turn } Else { Left_turn; // Left } A = T1; // T1 size determines high level continuation time TH0 = (65536-a) / 256; TL0 = (65536-a)% 256; // Rear load initial value } } void time_init () { TMOD = 0x01; // Working mode Software start timer Timer function 1 Timer 0 TH0 = (65536-a) / 256; TL0 = (65536-a)% 256; // Loading initial value ET0 = 1; // Turn on the timer interrupt enable EA = 1; // Open the total interrupt Tr0 = 0; } // ************************************** // Void delay (uchar z) // Delayed at 12M Z milliseconds { UINT X, Y; For (x = z; x>0; x -) FOR (Y = 110; Y>0; Y -); } // **************************** // Void keyscan () { IF (STOP == 0) { Tr0 = 0; // Close the timer 0 to stop rotation END_TURN; } IF (left == 0) { Tr0 = 1; DFLAG = 1; // Steering sign set left turn left } IF (right == 0) { Tr0 = 1; DFLAG = 0; // Turning flag reset } IF (accelerate == 0) { DELAY (5); // Delay shaking IF (accelerate == 0) { While (accelerate == 0); // Waiting for loosening COUNT ++; IF (count == 1) { T0 = ​​20000; T1 = 30000; // Duty cycle is 60% } IF (count == 2) { T0 = ​​15000; T1 = 35000; // Duty cycle is 70% } IF (count == 3) { T0 = ​​10000; T1 = 40000; // Duty cycle is 80% } IF (count == 4) { T0 = ​​5000; T1 = 45000; // Duty cycle is 90% } IF (count == 5) { count = 0; } } } }, Read the full text

     

     

     

     

    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