只是一个普通的翻转
/********************************** (C) COPYRIGHT ******************************* * File Name : main.c * Author : WCH * Version : V1.0.0 * Date : 2023/12/22 * Description : Main program body. ********************************************************************************* * Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd. * Attention: This software (modified or not) and binary are used for * microcontroller manufactured by Nanjing Qinheng Microelectronics. *******************************************************************************/ /* *@Note *GPIO routine: *PD0 push-pull output. * */ #include "debug.h" /* Global define */ /* Global Variable */ /********************************************************************* * @fn GPIO_Toggle_INIT * * @brief Initializes GPIOA.0 * * @return none */ void GPIO_Toggle_INIT(void) { GPIO_InitTypeDef GPIO_InitStructure = {0}; RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOC, &GPIO_InitStructure); } /********************************************************************* * @fn main * * @brief Main program. * * @return none */ int main(void) { u8 i = 0; NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1); SystemCoreClockUpdate(); Delay_Init(); #if (SDI_PRINT == SDI_PR_OPEN) SDI_Printf_Enable(); #else USART_Printf_Init(115200); #endif printf("SystemClk:%d\r\n", SystemCoreClock); printf( "ChipID:%08x\r\n", DBGMCU_GetCHIPID() ); printf("GPIO Toggle TEST\r\n"); GPIO_Toggle_INIT(); while(1) { Delay_Ms(250); GPIO_WriteBit(GPIOC, GPIO_Pin_1, (i == 0) ? (i = Bit_SET) : (i = Bit_RESET)); } }
ms级看还正常,
但是us级,上升沿这个为什么要多一个这出来,每个上升沿都有,小白的我 ds18b20 us控制异常,是不是要加外围电阻电容呀