标题: 求大神指导,stm32控制sr505,一直没有实现功能 [打印本页]

作者: 阳新墨    时间: 2018-6-29 23:35
标题: 求大神指导,stm32控制sr505,一直没有实现功能
include "bodyinduction.h"
#include "led.h"
int BodyInduction;
/*******************************************************************************
* Function Name  :
* Description    :         èËìåoìía¸Dó|  òy½ÅμÄÅäÖà        
* Input          : None                                                
* Output         : None
* Return         : None
*******************************************************************************/
void Body_Configuration(void)
{
        GPIO_InitTypeDef GPIO_InitStructure;
        RCC_APB2PeriphClockCmd(        RCC_APB2Periph_GPIOG,ENABLE);

        GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPD;//¸Dó|¸ßμçÆ½£¬êÇêäèëÏÂà-°é
        GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
       
        GPIO_InitStructure.GPIO_Pin = BODY_GPIO_Pin;
        GPIO_Init(BODY_GPIO_PORT,&GPIO_InitStructure);


}

/*******************************************************************************
* Function Name  :
* Description    :        èËìåoìía¸Dó|oˉêy£¬μ±¸Dó|μ½èË£¬êä3ö¸ßμçÆ½£¬2¢½«è«¾Ö±äá¿BodyInductionÖÃ1
                                                                                                        ·ñÔòÖÃ0;   
* Input          : None                                                
* Output         : None
* Return         : None
*******************************************************************************/

void Run_Induction(void)
{
        if(1 == GPIO_ReadInputDataBit(BODY_GPIO_PORT,BODY_GPIO_Pin) ) BodyInduction=1;
        else BodyInduction=0;

}

/*******************************************************************************
* Function Name  :
* Description    :        ÅD¶Ï£¬è«¾Ö±äá¿BodyInduction  Îa1 ê±£¬ÔËDD3ìDò      
* Input          : None                                                
* Output         : None
* Return         : None
*******************************************************************************/
void Run_BodyInduction_Action(void)
{
        if(1==BodyInduction)
        {
                led1=!led1;
               
        }

}






欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1