只是一個普通的翻轉(zhuǎn)
??
/**********************************?(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控制異常,是不是要加外圍電阻電容呀