版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、1.1-GPIO操作#define GPIO_Pin_3 (uint16_t)0x0008) #define GPIO_Pin_4 (uint16_t)0x0010) 这里要使用3,4脚,找到路径,在#define GPIO_Pin_1 (uint16_t)0x0002) #define GPIO_Pin_2 (uint16_t)0x0004)下面添加3,4为1时就是0008和00101.1.2#define GPIO_Pin_7 (uint16_t)0x0080)#define GPIO_Pin_13 (uint16_t)0x2000)同上第7,13位为11.1.3 GPIO_InitStr
2、ucture.GPIO_Mode = GPIO_Mode_Out_PP ; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; 实现GPIO在推挽模式和输出最大速度为50MHz 1.1.4 STM_EVAL_LEDOn(LED1); Delay(0xAFFFF); STM_EVAL_LEDOn(LED2);Delay(0xAFFFF); STM_EVAL_LEDOn(LED3); Delay(0xAFFFF);STM_EVAL_LEDOn(LED4); Delay(0xAFFFF); 函数STM_EVAL_LEDOn(LED):实现LED点亮1.
3、1.5 STM_EVAL_LEDOn(LED1); Delay(0xAFFFF); STM_EVAL_LEDOn(LED2); Delay(0xAFFFF); STM_EVAL_LEDOn(LED3); Delay(0xAFFFF); STM_EVAL_LEDOn(LED4); Delay(0xAFFFF); /* Turn off */STM_EVAL_LEDOff(LED1);Delay(0xAFFFF);STM_EVAL_LEDOff(LED2);Delay(0xAFFFF);STM_EVAL_LEDOff(LED3);Delay(0xAFFFF);STM_EVAL_LEDOff(LED
4、4);Delay(0xAFFFF);函数STM_EVAL_LEDOn(LED):实现LED点亮函数STM_EVAL_LEDOff(LED):实现LED关闭1.1.6 STM_EVAL_LEDOff(LED3); Delay(0xAFFFF);STM_EVAL_LEDOff(LED4);函数STM_EVAL_LEDOff(LED):实现LED关闭为了看清加个延时 1.1.7STM_EVAL_LEDOff(LED2);STM_EVAL_LEDOff(LED4); 函数STM_EVAL_LEDOff(LED):实现LED关闭1.1.8STM_EVAL_LEDOn(LED3); Delay(0xAFF
5、FF); STM_EVAL_LEDOff(LED3);Delay(0xAFFFF); STM_EVAL_LEDOn(LED4);STM_EVAL_LEDOff(LED4);按要求点亮1.1.9STM_EVAL_LEDOn(LED1);Delay(0xAFFFF); STM_EVAL_LEDOff(LED1);STM_EVAL_LEDOn(LED3); Delay(0xAFFFF); STM_EVAL_LEDOff(LED3);按要求点亮 1.1.10 Delay(0xFFFFFF); STM_EVAL_LEDOn(LED1); Delay(0xFFFFFF); STM_EVAL_LEDOff(
6、LED1); STM_EVAL_LEDOn(LED3); STM_EVAL_LEDOff(LED3);按要求点亮1.2-中断控制器使用方法 TIM_ITConfig(TIM2, TIM_IT_Update, ENABLE);直接copy下面的TIM_ITConfig(TIM3,TIM_IT_Update,ENABLE); 1.2.2 NVIC_InitStructure.NVIC_IRQChannel = 28; /考试要求正确修改 Word中tim2是通道28,编译有下面NVIC_IRQChannelPreemptionPriority转到宏定义有个uint8_t NVIC_IRQChann
7、el;1.2.3 NVIC_InitStructure.NVIC_IRQChannel = 29; Word中tim3是通道29,编译有下面NVIC_IRQChannelPreemptionPriority转到宏定义有个uint8_t NVIC_IRQChannel;1.2.4 NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1; NVIC_InitStructure.NVIC_IRQChannelPreemption
8、Priority = 2;Word中NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority:优先级配置1.2.5 NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1; Word中TIM2拥有抢占优先级0,响应优先级0;TIM3拥有抢占优先级1,响应优先级1;TIM4拥有抢占优先级2,响应优先级0。 NVIC_InitStructure.NVIC_IRQChannelSubPriori
9、ty = 0; 1.2.6 NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority=2; NVIC_InitStructure.NVIC_IRQChannelSubPriority=0;Word里面有两大窜,使其拥有抢占优先级2,响应优先级01.2.7NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;1.2.8/* Enable the USARTy_DMA1_IRQn Interrupt */ NVIC_InitStructure.NVIC_IRQChannel = 16; 编译进入上面注解USAR
10、Ty_DMA1_IRQn可以看到使用16通道,前半部分下面有 1.2.9/* Toggle LED3 */ STM_EVAL_LEDToggle(LED3); Word有个函数STM_EVAL_LEDToggle(LEDx):LEDx状态翻转上面注解有led3 1.2.10 /* Toggle LED32*/ STM_EVAL_LEDToggle(LED2); Word有个函数STM_EVAL_LEDToggle(LEDx):LEDx状态翻转上面注解有led21.3-PWM脉冲宽度调制 printf("PWM Frequency 36KHzn"); word中已知TIMX3
11、CLK36MHz,分频系数Prescaler=0,l TIM3的时钟频率: TIM3 counter clock=TIM3CLK/(Prescaler + 1)。l TIM3的频率: Frequence=TIM3 counter clock/(TIM3_ARR+1)程序中tim3_arrshi 999,所以最后36khz 1.3.2 printf("PWM Frequency 18KHzn"); word中已知TIMX3CLK36MHz,分频系数Prescaler=1,l TIM3的时钟频率: TIM3 counter clock=TIM3CLK/(Prescaler +
12、1)。l TIM3的频率: Frequence=TIM3 counter clock/(TIM3_ARR+1)程序中tim3_arrshi 999,所以最后18khz1.3.3 printf("PWM Frequency 12KHzn"); word中已知TIMX3CLK36MHz,分频系数Prescaler=2,l TIM3的时钟频率: TIM3 counter clock=TIM3CLK/(Prescaler + 1)。l TIM3的频率: Frequence=TIM3 counter clock/(TIM3_ARR+1)程序中tim3_arrshi 999,所以最后1
13、2khz1.3.4 printf("PC.08:TIM3_CH3 25%n"); printf("PC.09:TIM3_CH4 12.5%n"); word1.3.5 printf("PC.06:TIM3_CH1 12.5%n"); printf("PC.07:TIM3_CH2 22.5%n"); printf("PC.08:TIM3_CH3 52.5%n"); printf("PC.09:TIM3_CH4 60%n"); 1.3.6/* Channel1 configura
14、tion */ TIM_SelectOCxM(TIM1, TIM_Channel_1, TIM_OCMode_PWM1); TIM_CCxCmd(TIM1, TIM_Channel_1, TIM_CCx_Enable); TIM_CCxNCmd(TIM1, TIM_Channel_1, TIM_CCxN_Disable); /* Channel3 configuration */ TIM_SelectOCxM(TIM1, TIM_Channel_3, TIM_OCMode_PWM1); TIM_CCxCmd(TIM1, TIM_Channel_3, TIM_CCx_Disable); TIM_
15、CCxNCmd(TIM1, TIM_Channel_3, TIM_CCxN_Enable); /* Channel2 configuration */ TIM_CCxCmd(TIM1, TIM_Channel_2, TIM_CCx_Disable); TIM_CCxNCmd(TIM1, TIM_Channel_2, TIM_CCxN_Disable);step=1;就是copy上面5的通道3不变,1,2,对换,之后复位step=1;(213的顺序两行这里通道2两行,3通道TIM_CCx后几个都是Disable)1.3.7 /* Channel3 configuration */ TIM_Sel
16、ectOCxM(TIM1, TIM_Channel_3, TIM_OCMode_PWM1); TIM_CCxCmd(TIM1, TIM_Channel_3, TIM_CCx_Disable); TIM_CCxNCmd(TIM1, TIM_Channel_3, TIM_CCxN_Enable); /* Channel1 configuration */ TIM_CCxCmd(TIM1, TIM_Channel_1, TIM_CCx_Disable); TIM_CCxNCmd(TIM1, TIM_Channel_1, TIM_CCxN_Disable); /* Channel2 configura
17、tion */ TIM_SelectOCxM(TIM1, TIM_Channel_2, TIM_OCMode_PWM1); TIM_CCxCmd(TIM1, TIM_Channel_2, TIM_CCx_Enable); TIM_CCxNCmd(TIM1, TIM_Channel_2, TIM_CCxN_Disable); step+; 213的顺序两行这里通道1两行,就是copy上面4的通道2不变,1,3,对换,之后step+;1.3.8 /* Channel3 configuration */ TIM_CCxCmd(TIM1, TIM_Channel_3, TIM_CCx_Disable)
18、; TIM_CCxNCmd(TIM1, TIM_Channel_3, TIM_CCxN_Disable); /* Channel1 configuration */ TIM_SelectOCxM(TIM1, TIM_Channel_1, TIM_OCMode_PWM1); TIM_CCxCmd(TIM1, TIM_Channel_1, TIM_CCx_Disable); TIM_CCxNCmd(TIM1, TIM_Channel_1, TIM_CCxN_Enable); /* Channel2 configuration */ TIM_SelectOCxM(TIM1, TIM_Channel_
19、2, TIM_OCMode_PWM1); TIM_CCxCmd(TIM1, TIM_Channel_2, TIM_CCx_Enable); TIM_CCxNCmd(TIM1, TIM_Channel_2, TIM_CCxN_Disable); step+; 213的顺序两行这里通道3两行,这里标2,就是通道2,3对换1不变,之后step+;1.4-ADC模拟数字转换器设计ADCx->CR1=(uint32_t)0x00000100;Word中ADC的工作方式为独立模式位19到16为0一共32位即 (uint32_t)0x00000000) 使能扫描模式。位8为1就是0x000001001
20、.4.2ADC_InitStructure.ADC_Mode=ADC_Mode_Independent;在独立模式下先编译从下面ADC_ExternalTrigConv_None;转到宏定义区,上面找到独立模式#define ADC_Mode_Independent (uint32_t)0x00000000)就ok1.4.3ADC_InitStructure.ADC_Mode=ADC_Mode_Independent; 独立模式下转一下就看到了ADC_InitStructure.ADC_ContinuousConvMode = ENABLE; 连续执行转换是否使能就好ADC_InitStruc
21、ture.ADC_NbrOfChannel = 1; 且被转换的ADC通道数为1。1.4.4ADC_InitStructure.ADC_Mode=ADC_Mode_Independent;ADC_InitStructure.ADC_ContinuousConvMode = DISABLE;单次转换ADC_InitStructure.ADC_NbrOfChannel = 1;1.4.5ADC_InitStructure.ADC_DataAlign=ADC_DataAlign_Right;ADC_InitStructure.ADC_ContinuousConvMode = ENABLE; 连续转换
22、从ADC_Mode_Independent;转到宏定义区在下面找到对齐方式#define ADC_DataAlign_Right (uint32_t)0x00000000)1.4.6ADC_InitStructure.ADC_ContinuousConvMode = ENABLE; 连续转换ADC_InitStructure.ADC_DataAlign=ADC_DataAlign_Left;从ADC_Mode_Independent;转到宏定义区在下面找到对齐方式#define ADC_DataAlign_Left (uint32_t)0x00000800)1.4.7printf("
23、ADC rusult: %3.2fVr",(float)(ADCConvertedValue)/0xfff*3.21);word中数据传输到ADC_ConvertedValue变量中就他1.4.8ADC_SoftwareStartConvCmd(ADC1, ENABLE);程序上面注解/* Start ADC1 Software Conversion */使能ADC1实现模数转换1.4.9printf("ADCValue: %3.2fVr",(float)(ADCConvertedValue)/0xfff*3.21);ADC_ConvertedValue变量中 0
24、3.21V;ADC精度为12位1.4.10 ADC1,ADC_Channel_16 参数ADCx:ADC序号x参数ADC_Channel_x:ADC通道x1.5-DAC模拟数据转换器设计DAC_InitStructure.DAC_WaveGeneration =DAC_WaveGeneration_Noise;不知道要填什么,进入DAC_Trigger_Software,找到一个噪声就ok1.5.2DAC_SetChannel1Data(DAC_Align_12b_L, 0x7FF0); word中数据为2047时转换16进制就是0x7ff0,后四位保留1.5.3DAC_InitStructu
25、re.DAC_WaveGeneration = DAC_WaveGeneration_Triangle;生成三角波编译进入DAC_Trigger_T2_TRGO;因为类型一样定义就在一起下面有个#define DAC_WaveGeneration_Triangle 就是三角波1.5.4DAC_InitStructure.DAC_LFSRUnmask_TriangleAmplitude =(uint32_t)0x00000A80; 幅值为2047就是位11到位8为1010为A,位7到位6,使能三角波10为8,加起来就是A801.5.5 DMA_InitStructure.DMA_MemoryBa
26、seAddr = (uint32_t)&Escalator8bit;取寄存器地址前面有个const uint8_t Escalator8bit6= 0x0, 0x33,0x66,0x99,0xCC,0xFF;不懂1.5.6DAC_InitStructure.DAC_WaveGeneration =(uint32_t)0x00000000; 编译,从DAC_Trigger_T6_TRGO;转到定义上面有个#define DAC_Trigger_None (uint32_t)0x00000000)把后面的十六进制填进去就好,连续传输到数据移位寄存器1.5.71,DAC_InitStruct
27、ure.DAC_LFSRUnmask_TriangleAmplitude = DAC_LFSRUnmask_Bits11_0;word线性反馈移位寄存器LFSR长度为12位编译从下面DAC_Trigger_Software;转到找设置位的,12位就是DAC_LFSRUnmask_Bits11_0;2,DAC_SetChannel1Data(DAC_Align_12b_L,0x5FF0);word里面DAC_SetChannel1Data(参数1, 参数2):设置通道1的数据寄存器函数一般为左对齐就是DAC_Align_12b_L,后一个参数就是0x5FF01.5.8DAC_InitStruct
28、ure.DAC_LFSRUnmask_TriangleAmplitude =DAC_TriangleAmplitude_2047;Word中产生2047幅度波,这里波幅就是2047,但不知道怎么写就先编译从下面的DAC_OutputBuffer_Disable;转到宏定义区找到DAC_TriangleAmplitude_2047;1.5.9DAC_SetDualChannelData(DAC_Align_12b_R, 0x111, 0x111);Word 中DAC_SetDualChannelData(参数1,参数2,参数3):设置双通道DAC数据函数,后面两个值有VREF*(DHRx / 4
29、095)= VREF/15算出dhrx=273化为十六进制为0x111,还是直接记住比较好1.5.10DAC_InitStructure.DAC_LFSRUnmask_TriangleAmplitude = DAC_LFSRUnmask_Bits8_0;Word移位寄存器LFSR长度为9位从下面DAC_Trigger_Software;转到找宏定义区,9位就是#define DAC_LFSRUnmask_Bits8_0 (uint32_t)0x00000800)2.1-SPI串行外设接口设计(温湿度)SHT75_DAT_L;word中DATA翻转为低电平上面就有SHT75_DAT_LSHT75
30、_CLK_L; SCK变为低电平上面就有SHT75_CLK_Lsht11_Delay();SHT75_CLK_H;随后是在SCK时钟高电平时DATA翻转为高电平2.1.2SHT75_DAT_L; DATA翻转为低电平SHT75_DAT_H; DATA翻转为高电平word中有2.1.3SHT75_DAT_H;SCK变为低电平,随后是在SCK时钟高电平时DATA翻转为高电平SHT75_CLK_H; SCK时钟高电平时DATA翻转为低电平2.1.4SHT75_DAT_H; word当SCK时钟高电平时DATA翻转为低电平相反就是高SHT75_CLK_L; 要想翻转,下面有个clkH那这里就必须是_C
31、LK_L;2.1.5 temp_val|= tmp_byte; 就是把上面CACU_CRC = Table(CACU_CRCtmp_byte); tmp_byte给这个变量2.1.6 temp_val |= tmp_byte<<8; temp_val是16位,存放两个8位,先放高8位2.1.7 *t= temp_val; 定义了一个指针取已经采集到的温度2.1.8 hum_val |= tmp_byte<<8; 程序下面有tmp_byte = s_Read_SHT11_Byte(); /读取高8位 CACU_CRC = Table(CACU_CRCtmp_byte);
32、/进行第二次CRC temp_val |= tmp_byte<<8;意思把高8位给hum_val2.1.9 hum_val |= tmp_byte; 程序下面有 tmp_byte = s_Read_SHT11_Byte(); /读取低8位 CACU_CRC = Table(CACU_CRCtmp_byte); /进行第三次CRC temp_val |= tmp_byte;2.1.10 *h =hum_val; 上面有个tmp_byte = s_Read_SHT11_Byte(); CACU_CRC = Table(CACU_CRCtmp_byte); /进行第三次CRC hum_v
33、al |= tmp_byte; 完成第三次校验就是最终值给指针2.2内部集成电路IIC接口设计(光照度)#define EEPROM_WriteAddress1 0x88 word中有 #define EEPROM_ReadAddress1 0x88uint8_t Tx1_Buffer = "ASTM32F10x I2C Firmware "第一个字母必需是大写A,后面有个函数会都这个数组的第一个字母就是A了,后面是什么无所谓不会都到2.2.2#define EEPROM_WriteAddress1 0x99 #define EEPROM_ReadAddress1 0x99
34、uint8_t Tx1_Buffer = "BASTM32F10x I2C Firmware "第一个字母必需是大写B,后面有个函数会都这个数组的第一个字母就是A了,后面是什么无所谓不会都到2.2.3#define EEPROM_HW_ADDRESS 0xA0 WORD中E0,E1 and E2三个引脚都接地,所以物理地址空间为0XA0printf("EEPROM PHY ADDRESS:0xA0");2.2.4/* Write on I2C EEPROM from EEPROM_WriteAddress1 */ * Read from I2C EEPR
35、OM from EEPROM_ReadAddress1 */ I2C_EE_BufferRead(Rx1_Buffer, EEPROM_ReadAddress1, BufferSize1); I2C_EE_BufferWrite(Tx1_Buffer, EEPROM_WriteAddress1, BufferSize1); 上面注释讲实现Tx1_Buffer写操作,copy都操作I2C_EE_BufferWrite(Tx2_Buffer,EEPROM_WriteAddress2,BufferSize2); 实现Tx2_Buffer写操作2.2.5I2C_EE_BufferWrite(Tx1_B
36、uffer, EEPROM_WriteAddress1, BufferSize1); /* Read from I2C EEPROM from EEPROM_ReadAddress1 */ /考试要求1: I2C_EE_BufferRead(Rx1_Buffer, EEPROM_ReadAddress1, BufferSize1);实现从EEPROM读数据,地址为EEPROM_ReadAddress1,字节数为BufferSize1,赋给变量 Rx1_BufferI2C_EE_BufferRead(Rx2_Buffer, EEPROM_ReadAddress2, BufferSize2); 2
37、.2.6 I2C_EE_BufferWrite(Tx1_Buffer, EEPROM_WriteAddress1, BufferSize1); 什么题不解释 I2C_EE_BufferRead(Rx2_Buffer, EEPROM_ReadAddress2, BufferSize2);2.2.7Lux=CalculateLux(GainSetHigh>>4, IntegScal1000, LightIntensity0, LightIntensity1, T); 程序下面直接copy过来2.2.8Word中正确实现SlaveAddressVDD的地址映射#defineSlaveAd
38、dressVDD0x49模仿下面的,word中1001001就是ox492.2.9有个路径:Address.h。找不到在左侧light文件右击添加文档,加进来就ok #defineSlaveAddressVDD0x49 Lux=CalculateLux(GainSetHigh>>4, IntegScal1000, LightIntensity0, LightIntensity1, T);下面有一模一样的2.2.10#defineSlaveAddressVDD0x49 Lux=CalculateLux(GainSetHigh>>4, IntegScal1000, Ligh
39、tIntensity0, LightIntensity1, T);程序错误代码全乱了,就是不对,考试不会 2.3-通用同步异步收发机USART设计 115200; USART_Parity_No; PUTCHAR_PROTOTYPE Word中波特率115200,无校验,调用这个函数(没有括号)复位超级终端设置好会显示USART Printf Example: retarget the C library printf function to the USARTUSART Printf Example: hello kitty 2.3.2 9600; USART_Parity_No; PUTC
40、HAR_PROTOTYPE Word中波特率9600,无校验,调用这个函数(没有括号)复位超级终端设置好会显示USART Printf Example: retarget the C library printf function to the USARTUSART Printf Example: hello kitty 2.3.3 57600 USART_Parity_No; PUTCHAR_PROTOTYPE Word中波特率9600,无校验,调用这个函数(没有括号)复位超级终端设置好会显示USART Printf Example: retarget the C library print
41、f function to the USARTUSART Printf Example: hello kitty 2.3.4USART_InitStructure.USART_BaudRate = 115200; RxBufferRxCounter = (USART_ReceiveData(EVAL_COM1) & 0x7F); 是为了计数在下面函数中printf("%c",RxBufferRxCounter+);#define RxBufferSize 0xA 要求10个字符转换成十六进制为A 通信成功在电脑上输入十个键值在lcd上面显示出来2.3.5 USART
42、_InitStructure.USART_Parity = USART_Parity_Odd; 奇校验 if(RxCounter = NbrOfDataToRead) 判断用= #define RxBufferSize 0x14 输入20十个键值十六进制为14通信成功在电脑上输入20个键值在lcd上面显示出来2.3.6USART_InitStructure.USART_BaudRate = 115200; printf("%c",RxBufferRxCounter+); 加一输出下一个键值#define RxBufferSize 0xf 要求十五个键值 2.3.7USART
43、_InitStructure.USART_BaudRate = 115200; /考试要求2,添加一行,用printf语句实现版本号显示 printf("VER:%8.0xn", version);word中vs8 EM380C_Get_ver(u32* version) 函数功能:用于获得EM380C的固件版本号,8位 ret = send_cmd(EMSP_CMD_GET_VER, 0, NULL, 0); ver前后呼应,和上面输出的一样2.3.8USART_InitStructure.USART_BaudRate = 115200;USART_InitStructu
44、re.USART_Parity =USART_Parity_No ;ret = send_cmd(EMSP_CMD_GET_VER, 0, NULL, 0); main.c中有 printf("VER:%8.0xn",version);所以要使用ver2.3.9 USART_InitStructure.USART_BaudRate = 115200; ret = send_cmd(EMSP_CMD_SCAN_AP, 0, NULL, 0);发送获取AP命令printf("%s", APlist_tmp->AP_NAME); 正确输出AP的SSID
45、号而不是信号 2.3.10 printf("VER:%8.0xn",version); 同上 printf("%s", APlist_tmp->AP_NAME);输出获得AP的SSID号 free(EM380C_APLst_now);free是c语言中的是释放空间函数,注解里有2.4-Ethernet以太网设计char const *hosts1 = "WWW" ;格式没有什么逗号 IP1 192 IP2 168 IP3 0IP4 120WORD 2.4.2 char const *hosts1 = “”; IP1 192 IP
46、2 168 IP3 0IP4 100WORD2.4.3 IP1 192 IP2 168 IP3 0 IP4 90 WORD2.4.4 IP1 192 IP2 168 IP3 0 IP4 78WORD2.4.5#define MCR_LM 0x00001000 #define MCR_DM 0x00000800 #define MCR_IPCO 0x00000400 Word文档中为1,第十二位1000,第一个是零位2.4.6#define MCR_TE 0x00000008 #define MCR_RE 0x00000004 Word文档中为1 2.4.7#define MCR_RE 0x00
47、000004 Word文档中为1 添加ETH_STM32x.h文件我自己的 添加文档tcp_cm3.lib2.4.8路径不对,应该是 TCPnet_examplesLibrary Net_Config.c#define HTTP_AUTHPASSW "111111" 在这里添加密码来自word2.4.9路径不对,应该是TCPnet_examplesLibrary Net_Config.c#define HTTP_AUTHPASSW "111222” 在这里添加密码来自word2.4.10路径不对,应该是TCPnet_examplesLibrary Net_Conf
48、ig.c#define HTTP_AUTHPASSW "222222" 在这里添加密码来自word3.1-人机交互应用case JOY_LEFT: 重要提示 px_o=px;px-=1; if(px<0) px=3; case JOY_RIGHT: 重要提示 px_o=px;px+=1;if(px>3) px=0; 上下对调3.1.2 case JOY_UP: 重要提示 py_o=py;py-=1;if(py<0) py=3; case JOY_DOWN: 重要提示 py_o=py;py+=1;if(py>3) py=0; 上下对调3.1.3case
49、 JOY_UP: py_o=py;px_o=px;if(py) py=0; else py=1; case JOY_DOWN: py_o=py;px_o=px;if(py) py=0; else py=1; case JOY_LEFT: py_o=py;px_o=px;if(px) px=0; else px=1; case JOY_RIGHT: py_o=py;px_o=px;if(px) px=0; else px=1;上下为y,左右为x 3.1.4 /* Toggle LD1 */STM_EVAL_LEDToggle(LED1);把led4改为led1 3.1.5 if (TS_Stat
50、e->Y > 180) && (TS_State->Y < 220)&&(TS_State->X < 70) && (TS_State->X > 10) else if(TS_State->Y > 180) && (TS_State->Y < 220)&&(TS_State->X < 150) && (TS_State->X > 90) else if(TS_State->Y > 180) &
51、amp;& (TS_State->Y < 220)&&(TS_State->X < 230) && (TS_State->X > 170) else if(TS_State->Y > 180) && (TS_State->Y < 220)&&(TS_State->X < 310) && (TS_State->X > 250) if (TS_State->Y > 180) && (TS_State-
52、>Y < 220)&&(TS_State->X < 310) && (TS_State->X > 250) else if(TS_State->Y > 180) && (TS_State->Y < 220)&&(TS_State->X < 230) && (TS_State->X > 170) else if(TS_State->Y > 180) && (TS_State->Y < 220)&
53、amp;&(TS_State->X < 150) && (TS_State->X > 90) else if(TS_State->Y > 180) && (TS_State->Y < 220)&&(TS_State->X < 70) && (TS_State->X > 10) 前一半一样后面一半大对调,反过来 3.1.6if (TS_State->Y > 205) && (TS_State->Y < 230)&a
54、mp;&(TS_State->X < 60) && (TS_State->X > 20) else if(TS_State->Y > 165) && (TS_State->Y < 190)&&(TS_State->X < 60) && (TS_State->X > 20) else if(TS_State->Y > 125) && (TS_State->Y < 150)&&(TS_State-&g
55、t;X < 60) && (TS_State->X > 20) else if(TS_State->Y > 85) && (TS_State->Y < 110)&&(TS_State->X < 60) && (TS_State->X > 20) if (TS_State->Y > 85) && (TS_State->Y < 110)&&(TS_State->X < 60) && (TS_State->X &
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2023年高考一轮多维练小题-地球的运动(解析版)
- 北京版四年级上册数学第二单元 乘法 测试卷附参考答案(b卷)
- 装饰装修工程设计施工总承包(EPC)项目-技术标文件
- 2022年大学统计学专业大学物理二期末考试试卷A卷-附解析
- 2022年大学药学专业大学物理下册月考试卷B卷-附解析
- 2022年销售工作实习报告总结
- 年度客运机市场分析及竞争策略分析报告
- 居家养老服务中心环境改善方案
- 餐饮行业食品安全配送方案
- 心理健康教育评价体系方案
- 机场跑道水泥稳定碎石基层施工方案及工艺方法
- ISO9001体系文件与IRIS标准条款对应表
- 汉语教师志愿者培训大纲
- 护理导论 评判性思维
- SPC培训资料_2
- 学习适应性测验(AAT)
- ADS创建自己的元件库
- MATLAB仿真三相桥式整流电路(详细完美)
- 2019年重庆普通高中会考通用技术真题及答案
- 天秤座小奏鸣曲,Libra Sonatine;迪安斯,Roland Dyens(古典吉他谱)
- 钢筋混凝土工程施工及验收规范最新(完整版)
评论
0/150
提交评论