- 博客(7)
- 收藏
- 关注
原创 swkswk实验ADC0-0-0-7
ADCmain.c#include "stm32f10x.h"#include "sys.h"#include "delay.h"#include "adc.h"#include "hdg12864.h"/*将num(0-4095)显示到显示屏的第一行第一列*/void display(u16 num, int t){ u8 num1,num2,num3,num4; num4 = num%10; num3 = (num/10)%10; num2 = (num/100)%10;
2021-07-06 20:03:16 90
原创 swkswk实验配置串口10-0-0-6
配置串口1,使得串口循环输出mian.c#include "stm32f10x.h"#include "sys.h"#include "delay.h"#include "usart.h"#include "stdio.h"extern u8 USART_RX_BUF[USART_REC_LEN];//接受串口字符串的缓冲区extern u16 USART_RX_STA; //接受状态标识,第15位接收完成的标志位,0表示接受未完成,1表示接收完成 //第14位表示是否接
2021-07-06 20:00:51 108
原创 swkswk实验PWM控制电机0-0-0-5
PWM控制电机mian.c#include "stm32f10x.h"#include "sys.h"#include "delay.h"#include "motor.h"#include "timer.h"#include "key.h"int main(){ Motor_Init(); Key_Init(); TIM1_PWM_Init(4999, 71);//arr这个参数用于确定占空比有关 //这里的参数和TIM1_PWM_Init的第一个参数确定占空比 TIM_S
2021-07-06 19:56:02 96
原创 swkswk实验定时器LED1和LED20-0-0-4
定时器LED1和LED2mian.c#include "stm32f10x.h"#include "sys.h"#include "delay.h"#include "led.h"#include "timer.h"int main(){ LED_Init(); TIM2_Init(9999,7199); TIM3_Init(9999,7199); while(1) { } }led.c#include "led.h"#include "stm32f10
2021-07-06 19:50:19 67
原创 swkswk实验外中断数字加10-0-0-3
外中断数字加1mian.c#include "stm32f10x.h"#include "sys.h"#include "delay.h"#include "smg.h"#include "exti.h"int main(){ NVIC_Configuration(); SMG_Init(); Exti_Init(); while(1) { }}smg.c#include "smg.h"#include "stm32f10x.h"#include "sys.
2021-07-06 19:10:40 72
原创 swkswk实验码管循环显示00~FF0-0-0-2
码管循环显示00~FFmain.c#include "stm32f10x.h"#include "smg.h"uint16_t table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};uint16_t temp,i;//延时函数void Delay(unsigned int t){ unsigned int i=0,j=0; for(;i<t;i++)
2021-07-06 19:04:33 120
原创 swkswk实验循环点亮0-0-0-1
LED循环点亮main#include "stm32f10x.h"#include "sys.h"#include "delay.h"#include "led.h"int main(){ LED_Init(); while(1) { LED1=0;LED2=LED3=LED4=1;delay(500); LED2=0;LED1=LED3=LED4=1;delay(500); LED3=0;LED1=LED2=LED4=1;delay(500); LED4=0;LED
2021-07-06 18:57:48 100
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人