当前位置:网站首页>Day 1 of the 10 day smart lock project (understand the SCM stm32f401ret6 and C language foundation)
Day 1 of the 10 day smart lock project (understand the SCM stm32f401ret6 and C language foundation)
2022-06-13 01:50:00 【It's Beichen bupiacra】
10 Day Smart Lock Project Practice No 1 God ( Understand SCM STM32F401RET6 and C Language foundation )
One 、 Learning goals
Two 、 Understand SCM STM32F401RET6
4、STM32F401RE features
3、 ... and 、C Language foundation
1. data type
Commonly used 2 To the power of :
2^7 = 128
2^8 = 256
2^15 = 32768
2^16= 65536
51 Common data types of single chip microcomputer :
char: Occupy memory 1 byte Value range :-128~127 -2^7 ~ 2^7-1
unsigned char: 0~255
int: Occupy memory 4 byte Value range :-32768~32767
unsigned int: 0~65535
long int : Occupy memory 4 byte Value range :-2147483648~2147483647
unsigned long int:0~4294967295
Add :1 byte (byte) = 8 position (bit) Every representative 0/1
2. Hexadecimal conversion
① Convert decimal to binary
Eg:83
② 16 Binary to binary
Eg:0XFF
16 Base number : 0 1 2 3 4 5 6 7 8 9 A B C D E Ff:1 2 4 8
3. Variable
Before using variables, users need to define variables
Defining variables :
Int a; //a yes int Variable of type
char b;//b yes char Type variables
float c;//c yes float Type variables
Special prefix :
extern int a;// Statement int Variable of type a, Can be used across files , commonly .h It is defined
const int b=1;// Define an immutable variable , Use const Keyword should be given an initial value
static int c=1;// Static variables , Initialize only when first used , Equivalent to a global variable
4. Basic statement
Conditional statements :
If(a>0)
{
perform ;
}
Else、else if
remind :
If When judging the results of the following conditional statements , Non zero is true , Zero is false
Else There is no need to add a condition later
switch(ch)
{
case ‘a’: perform ; break;
case ‘b’: perform ; break;
}
Loop statement :
for
Format :
for(i=0;i<n;i++)
{
}
While
Format :
while(1)
{
;
}
do while;// It is applicable to the cycle without knowing the number of cycles
Control statement :
break;// Jump out of conditional statements and loop statements directly
coutinue;
goto
边栏推荐
- 【MathType】利用MathType输出LaTex样式的公式
- On February 26, 2022, the latest news of national oil price adjustment today
- Run Presto under docker to access redis and Bi presentation
- This of phaser3 add. sprite
- Machine learning basic SVM (support vector machine)
- What is Google plus large text ads? How to use it?
- D template instance does not match declaration
- Introduction to ROS runtime
- 三、上传织物图片至SQL Server并提供name进行展示织物照片
- [pytorch FAQ] numpy:dll load failed while importing_ multiarray_ Umath: the specified module could not be found.
猜你喜欢
Explanation and application of prefix sum (one-dimensional, two-dimensional)
Magics 23.0 how to activate and use the slice preview function of the view tool page
leetcode743. 网络延迟时间(中等, dijkstra)
Crypto JS reports uglifyjs error
Run Presto under docker to access redis and Bi presentation
About tkinter Canvas does not display pictures
Devexpress implementation flow chart
Uuid/guid introduction, generation rules and generation codes
Use mediapipe+opencv to make a simple virtual keyboard
matplotlib画图中文乱码
随机推荐
兴趣相似的受众群体
D template instance does not match declaration
六、出库管理功能的实现
VI keyboard diagram
General IP address, account and password of mobile IPv6 optical cat login, and mobile optical cat is in bridging mode
Pyflink implements custom sourcefunction
移动IPv6光猫登录的一般ip地址账号与密码,移动光猫变桥接模式
[MySQL password management] - [administrator password known, unknown (forgotten), cracked]
csdn涨薪技术之Jmeter接口测试数据库断言的实现与设计
6、 Implementation of warehouse out management function
详细受众特征详细解释
Alertwindowmanager pop up prompt window help (Part 1)
ng-tv-focusable
Note: common gadgets in project architecture
leetcode743. 网络延迟时间(中等, dijkstra)
Introduction to Google unit testing tools GTEST and gmoke
How does Google's audience work?
Magics 23.0 how to activate and use the slice preview function of the view tool page
PyFlink实现自定义SourceFunction
Workspace for ROS