当前位置:网站首页>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
边栏推荐
- [WSL2]限制WSL2可访问的硬件资源(CPU/内存)
- Project training (XVII) -- personal work summary
- VI keyboard diagram
- General IP address, account and password of mobile IPv6 optical cat login, and mobile optical cat is in bridging mode
- [WSL2]WSL2迁移虚拟磁盘文件ext4.vhdx
- csdn涨薪技术之Jmeter接口测试数据库断言的实现与设计
- Devaxpress Chinese description -- tdxgallerycontrol object (gallery component)
- MySQL - use field alias after where
- [soft test] software designer knowledge points sorting (to be updated)
- Run Presto under docker to access redis and Bi presentation
猜你喜欢

(no plug-in) summary of vim basic shortcut keys

30: Kakfa simulates JSON data generation and transmission

Establishment of microservice development environment

万字讲清 synchronized 和 ReentrantLock 实现并发中的锁

四、入库管理功能的完善

Calculation of accuracy, recall rate, F1 value and accuracy rate of pytorch prediction results (simple implementation)

URI, URL and urn difference, relation and syntax diagram

Introduction to ROS runtime

Plumber game

Explanation and application of prefix sum (one-dimensional, two-dimensional)
随机推荐
Alertwindowmanager pop up prompt window help (Part 1)
Developer contributions amd Xilinx Chinese Forum sharing - wisdom of questioning
Shell command notes
This of phaser3 add. sprite
关于tkinter.Canvas 不显示图片的问题
深度学习调参技巧详解
Design of distributed game server
Pytoch freeze pre training weights (feature extraction and BN layer)
MySQL download and installation
Spit bubbles (stack)
Introduction to common ROS commands
一种不带CPU的DPU架构:Hyperion
csdn涨薪技术之Jmeter接口测试数据库断言的实现与设计
如何通过受众群体定位解决实际问题?
MySQL ---- where后使用字段别名
Logging system in chromium
TensorFlow2的Conv1D, Conv2D,Conv3D机器对应的MaxPooling详解
Interruption of 51 single chip microcomputer learning notes (external interruption, timer interruption, interrupt nesting)
Vscode configuration header file -- Take opencv and its own header file as an example
30: Kakfa simulates JSON data generation and transmission

