欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標題: TOF10120 stm32串口一直輸r6# 求幫助 [打印本頁]

作者: zm我我跑到我的    時間: 2019-7-22 23:19
標題: TOF10120 stm32串口一直輸r6# 求幫助
/**
  ******************************************************************************
  * @file    main.c
  * @author  kevin_guo
  * @version V1.0.0
  * @date    12-15-2017
  * @brief   This file provides functions to main
  ******************************************************************************
  * @attention   
  ******************************************************************************
  */
  
/* Includes ------------------------------------------------------------------*/
#include "stm32f10x.h"   
#include <stm32f10x_conf.h>

#include "delay.h"
#include "usart.h"   

/* extern variables ----------------------------------------------------------*/
extern unsigned short int length_val;
extern unsigned char rxbuf[16],rxempty, rxcnt,rxflag,waitflag;
extern unsigned int timeout;
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private function ----------------------------------------------------------*/
//void BuzzerInit(voi
/
//  GPIO_InitTypeDef  GPIO_InitStructur
//
//  
//  
//  
//    RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE);
//    GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable,ENABLE
////    GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable,ENAB
//    GPIO_PinRemapConfig(GPIO_Remap_PD01,ENABLE
//    DBGMCU_Config(DBGMCU_CR_TRACE_IOEN,DISABLE
//
//  /* Enable the GPIO Clock */
//  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE

//    /* Configure the GPIO pin */
//  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_
//  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_P
//  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MH
//  GPIO_Init(GPIOB, &GPIO_InitStructure);
//
//    GPIO_ResetBits(GPIOB, GPIO_Pin_4
////    GPIO_SetBits(GPIOB, GPIO_Pin
/
/*******************************************************************************
* Function Name  : main
* Description    : main program body
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
int main(void)
{            
    unsigned char i;
   
//    BuzzerInit(
    Delay_Init();                 
   
    Uart_Init(9600);            
        
    Send_Data_To_UART1('s');
    Send_Data_To_UART1('5');
    Send_Data_To_UART1('-');
    Send_Data_To_UART1('1');
    Send_Data_To_UART1('#');
    Delay_mS(10);
    waitflag=1;
    while(waitflag==1);
    waitflag=0;
    Delay_mS(1000);
    rxcnt=0;
    while(1)
    {
        
        Send_Data_To_UART1('r');
        Send_Data_To_UART1('6');
        Send_Data_To_UART1('#');
        timeout=10000;
        while((rxflag==0)&&(timeout--));
        
        if(rxflag)
        {
            for(i=0; i<rxcnt; i++)
            {
                if(rxbuf=='m')                {                    if(rxbuf[i+1]=='m')   
/************************END OF FILE*************************/


作者: xiaozhong1314    時間: 2019-7-23 08:47
你下面的代碼就是輸出r6#啊

作者: zm我我跑到我的    時間: 2019-7-23 09:44
986212146 發表于 2019-7-23 08:47
你下面的代碼就是輸出r6#啊

如何改讓他輸出距離值

作者: xiaozhong1314    時間: 2019-7-23 16:04
代碼不完整啊




歡迎光臨 (http://m.raoushi.com/bbs/) Powered by Discuz! X3.1