17
2020
12

for的死循环和增强的for循环

死循环:for(;;){}增强for循环package com.xiao.demo;public class ForStrong {    public static void&a...
17
2020
12

IDEA可以反编译(也就是把生成的.class文件反编译)

源码:package com.xiao.switchs;public class Demo {    public static void main(String[] ...
17
2020
12

if语句

--> 多个elseif的时候一旦其中一个elseif语句检测为true,其中的elseif以及else语句都将跳过执行...
17
2020
12

java中next()和nextLine()的区别

package com.xiao.scanner;import java.util.Scanner;public class Demo {    public static&nbs...
17
2020
12

javadoc命令可以生成文档

当你在代码中加入文档注释时,运行Javadocxxx.java就会生成文档,点击index.html就会在浏览器中看到文档注释:/** * * @param name * @return */ ...
17
2020
12

变量的命名规范

--> 所有变量,方法,类名:见名知意类成员变量:首字母小写和驼峰原则:monthSal除了第一个单词以外,后面的单词首字母大写局部变量:首字母小写和驼峰原则常量:大写字母和下划线:MAX_VALUE类名:首字母大写和驼峰原则:Man,GooFo方法名:首字母小写和驼峰原则:runRun()...
16
2020
12

java中的实例变量和类变量的区别--直接看代码

public class Demo1 {    /*    实例变量:从属于对象;如果不自行初始化,这个类型的默认值    布尔值:默认值...
09
2020
12

AT指令配置蓝牙模块,通过连接蓝牙控制灯

#include "stm32f10x.h"#include "stdio.h"static GPIO_InitTypeDef   GPIO_InitStructure;static&nb...
08
2020
12

sprintf()函数-----c语言

--> C库函数intsprintf(char*str,constchar*format,...)发送格式化输出到str所指向的字符串。...
08
2020
12

memset()函数--------c语言

 void*memset(void*str,intc,size_tn)复制字符c(一个无符号字符)到参数str所指向的字符串的前n个字符。原型:void *memset(void *str, int c, size_...
08
2020
12

atoi() 函数------c语言

--> atoi()函数用来将字符串转换成整数(int),其原型为:intatoi(constchar*str);【函数说明】atoi()函数会扫描参数str字符串,跳过前面的空白字符(例如空格,tab缩进等,可以通过isspace()函数来检测),直到遇上数字或正负符号才开始做转换,...
08
2020
12

strtok函数c语言

#include <string.h>main(){    char s[] = "ab-cd : ef;gh :i-jkl;mnop;qrs-tu: ...
08
2020
12

strstr函数(c语言)

--> 返回值:返回str2在str1的首次出现的地址char str[]="1234xyz";char *str1=strstr(str,"34");输出结果是:34xyz...
06
2020
12

用超声波模块根据距离来控制灯的亮灭

#include "stm32f10x.h"#include "stdio.h"static GPIO_InitTypeDef   GPIO_InitStructure;stati...
28
2020
11

在stm32中如何判断GPIO引脚工作模式是输入还是输出呢?

--> 以(LED配置输出,key配置输入)为例子首先是LED;你的目的是控制单片机驱动灯的状态,由硬件连接来说一般都是一个灯+限流电阻,然后通过GPIO管脚的输出高低来控制灯的状态。来看看M4的GPIO管脚内部结构,只有配置输出才能控制I/O引脚的电平高低。才能控制电流流向。很明显输出做不得到。也就不能控...
27
2020
11

printf函数重定向【stm32】— > fputc()

#include "stm32f10x.h"#include "stdio.h"static GPIO_InitTypeDef   GPIO_InitStructure;static&nb...
27
2020
11

设置频率播放一小段音频(用到PWM和蜂鸣器)

#include "stm32f10x.h"#include "sys.h"static GPIO_InitTypeDef   GPIO_InitStructure;static ...
27
2020
11

【STM32】STM32端口复用和重映射的区别

...
26
2020
11

stm32串口1接收和发送数据的使用

#include "stm32f10x.h"#include "stdio.h"static GPIO_InitTypeDef   GPIO_InitStructure;static&nb...
25
2020
11

stm32运用PWM写呼吸灯的例子

代码不太完整,因为我的stm32板子的灯的引脚没有定时器所以就写个差不多的模板供以后参考#include "stm32f10x.h"#include "sys.h"static GPIO_InitTypeDef ...
24
2020
11

定时中断

#include "stm32f10x.h"static GPIO_InitTypeDef   GPIO_InitStructure;static NVIC_InitTypeDef  &nbs...
23
2020
11

SysTick 滴答定时器

#include "stm32f10x.h"static GPIO_InitTypeDef   GPIO_InitStructure;#define  PB5OUT(n)  &nbs...
23
2020
11

滴答硬件定时器

#include "stm32f10x.h"static GPIO_InitTypeDef   GPIO_InitStructure;#define  PB5OUT(n)  &nbs...
21
2020
11

stm32设置优先级分组抢占

#include "stm32f10x.h"static EXTI_InitTypeDef   EXTI_InitStructure;static GPIO_InitTypeDef  &nbs...
21
2020
11

stm32优先级和响应优先级

  @arg NVIC_PriorityGroup_0: 0 bits for pre-emption priority  //不支持抢占优先级  *  &...