找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 1690|回復(fù): 0
收起左側(cè)

求大神指導(dǎo),stm32控制sr505,一直沒有實現(xiàn)功能

[復(fù)制鏈接]
ID:261999 發(fā)表于 2018-6-29 23:35 | 顯示全部樓層 |閱讀模式
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;
               
        }

}

回復(fù)

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

手機版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機教程網(wǎng)

快速回復(fù) 返回頂部 返回列表