motor.c

来自「变压器绕线机源代码, 经过测试,可以正常运作.」· C语言 代码 · 共 44 行

C
44
字号
//============================
//绕线机程序

//============================
#ifndef __motor_c__
#define __motor_c__
#include "included.h"

//=================================
//===来回马达进来子程序
void for_m(uint t)
{        
    cp_h();
    delay_10us(t);
    cp_l();     
    delay_10us(t);  
}
//===============================
//===来回马达出去子程序
void back_m(uint t)
{    
    cp_h();          
    delay_10us(t);    
    cp_l();        
    delay_10us(t);     
}


//==============================
void delay_10us(t)
{
 uint i;
 for(i=0;i<7;i++)
  {
   _nop_();    
    }
 for(i=0;i<t;i++)
  {
    _nop_();          
    }
}

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?