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

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 2572|回復: 3
打印 上一主題 下一主題
收起左側

TOF10120 stm32串口一直輸r6# 求幫助

[復制鏈接]
跳轉到指定樓層
樓主
ID:538333 發表于 2019-7-22 23:19 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
/**
  ******************************************************************************
  * @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*************************/

分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復

使用道具 舉報

沙發
ID:421308 發表于 2019-7-23 08:47 | 只看該作者
你下面的代碼就是輸出r6#啊
回復

使用道具 舉報

板凳
ID:538333 發表于 2019-7-23 09:44 | 只看該作者
986212146 發表于 2019-7-23 08:47
你下面的代碼就是輸出r6#啊

如何改讓他輸出距離值
回復

使用道具 舉報

地板
ID:421308 發表于 2019-7-23 16:04 | 只看該作者
代碼不完整啊
回復

使用道具 舉報

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

本版積分規則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表