07 2019 档案
摘要:一、实验 1.光电反射理论是经过码盘的window时,电压变低,经过bar时,电压为高,这样可以通过检测到的脉冲数,来进行速度的获取。但是实际并不是这样, 反馈回来的信号是周期性的,经过试验发现,可以通过周期的时间间隔来进行速度的转换,周期越短,速度越快。 下图是逻辑分析仪采集到的波形: 码盘为25
阅读全文
摘要:1.引用变量是已定义变量的别名,这点是与指针本质的区别 int rats; int & rodents = rats; 两者指向相同的值和内存单元 2.声明引用时必须进行初始化 int rat; int & rodents; rodents = rats; 这种是不被允许的 3.引用非常适合用于结构
阅读全文
摘要:cmake_minimum_required(VERSION 2.8.3) PROJECT (HELLO) #工程名 set(CMAKE_BUILD_TYPE "Debug")set(CMAKE_BUILD_TYPE "RelWithDebInfo") SET( MAIN_LIST main.cpp
阅读全文
摘要:1.拼接字符串 2.对比字符串 3.字符串转整型 4.整型转字符串 5.取出指定的数据: 6.利用空闲中断接收不固定长度的数据
阅读全文
摘要:IAR: __no_init uint8_t _downflag @0x2001FF00;
阅读全文
摘要:static void ADC_Init(void) { /********************DMA配置**************************/ DMA2_Stream0->PAR=(uint32_t)&(ADC->CDR); //DMA外设地址 多重ADC->CDR DMA2_Stream0->M0AR=(uint32_t)_A...
阅读全文
摘要:1 static void GPIO_Init(void) 2 { 3 4 //sound 5 GPIO_Set(GPIOB,PIN4,GPIO_MODE_OUT,GPIO_OTYPE_PP,GPIO_SPEED_50M,GPIO_PUPD_NONE);//复用功能 6 PBout(4)=0; 7 8 //24路ADC采集 9 GPIO_Set...
阅读全文
摘要:1 static void RCC_Init(void) 2 { 3 RCC->APB1ENR|=1APB1ENR|=1APB2ENR|=1APB2ENR|=1APB2ENR|=1APB2ENR|=1APB2ENR|=1AHB1ENR|=1; //使能PORTA时钟 12 RCC->AHB1ENR|=1AHB1ENR|=1AHB1ENR|=1AHB1ENR|=1AHB1ENR...
阅读全文
摘要:SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOA, EXTI_PinSource0); EXTI_InitStructure.EXTI_Line=EXTI_Line0; EXTI_InitStructure.EXTI_LineCmd=ENABLE; EXTI_InitStructure.EXTI...
阅读全文
摘要:static void ADC_Config(void) { ADC_InitTypeDef ADC_InitStructure; /* ADCs DeInit */ //ADC_DeInit(ADC1); /* Initialize ADC structure */ ADC_StructInit(&ADC_InitStructure); ...
阅读全文
摘要:void TIM1_Configuration(void) { TIM_TimeBaseInitTypeDef TIM_Time1BaseStructure; TIM_OCInitTypeDef TIM_OCInitStructure; RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM1, ENABLE); /* Time 定时基础设置*...
阅读全文
摘要:1 void GPIO_Configuration(void) 2 { 3 RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE); 4 RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, ENABLE); 5 6 /* Configure ADC Channel as analog...
阅读全文
摘要:1 void _TIM4_Configuration(void) 2 { 3 /* TIM4 Configuration --------------------------------------------------- 4 Generates 7 PWM signals with 4 different duty cycles: 5 TIM4CL...
阅读全文
摘要:1 void _UART2_Configuration(void) 2 { 3 USART_InitTypeDef USART_InitStructure; 4 5 USART_OverSampling8Cmd(USART2, ENABLE); 6 USART_InitStructure.USART_BaudRate = 19200; 7 USART_Init...
阅读全文
摘要:1 void _DMA_Configuration(void) 2 { 3 DMA_InitTypeDef DMA_InitStructure; 4 5 /* DMA2 Stream0 channel0 configuration */ 6 DMA_InitStructure.DMA_Channel = DMA_Channel_0; 7 DMA_Init...
阅读全文
摘要:1 void ADC_Configure(void) 2 { 3 ADC_InitTypeDef ADC_InitStructure; 4 GPIO_InitTypeDef GPIO_InitStructure; 5 RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1,ENABLE); 6 RCC_AHBPeriphClock...
阅读全文
摘要:1 u8 _data1[4]; 2 void Configuration(void) 3 { 4 USART_InitTypeDef USART_InitStructure; 5 DMA_InitTypeDef DMA_InitStructure; 6 GPIO_InitTypeDef GPIO_InitStructure; 7 RCC_APB1PeriphClo...
阅读全文
摘要:1 void Configuration(void) 2 { 3 USART_InitTypeDef USART_InitStructure; 4 GPIO_InitTypeDef GPIO_InitStructure; 5 RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3, ENABLE); 6 //TX 7 GPIO...
阅读全文
摘要:1 static void TIM3_Configuration(void) //10ms 2 { 3 TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; 4 NVIC_InitTypeDef NVIC_InitStructure; 5 6 RCC_APB1PeriphClockCmd(RCC_APB1Periph_TI...
阅读全文
摘要:1 void USART3_Configuration(void) //串口3配置 S 2 { 3 DMA_InitTypeDef DMA_InitStructure; 4 USART_InitTypeDef USART_InitStructure; 5 GPIO_InitTypeDef GPIO_
阅读全文
摘要:1.构造函数 主要用于对类的private变量初始化 1 stock::stock(const std::string &co, long n, double pr) 2 { 3 company = co; 4 shares = n; 5 share_val = pr; 6 } 7 8 stock:
阅读全文
摘要:1.将.ycm_extra_conf.py拷贝到工程目录,然后打开,将自己的include目录添加进去
阅读全文

浙公网安备 33010602011771号