STM32F103C8T6 realizes water lamp (C language)

1, Experimental principle 1.1 stm32f103c8t6 introduction STM32F103C8T6 is a 32-bit microcontroller based on Cortex-M3 core launched by St. the hardware is packaged with LQFP48 and belongs to STM32 series of microcontrollers of ST company. 1.2 stm32f103c8t6 lighting principle of running water lamp Registers can store data and instructions, and ...

Posted by bav on Thu, 21 Oct 2021 20:41:29 -0700

C: Dynamic memory allocation

In dynamic memory allocation, the classic error cases are as follows: Case 1: Original code: void getmemory(char* p)//Should be changed to char** p { p = (char*)malloc(100);//The opened space address is not returned to str in the test function //Should read * p } void test(void) { char* str = NULL; getmemory(str); strcpy(str, "hello wor ...

Posted by EPCtech on Thu, 21 Oct 2021 12:55:28 -0700

Implementation of small projects: guessing numbers game + implementation of random number generator

catalogue 1. Implementation of guessing numbers game 1. Analysis 2. Code implementation 3. Involving function interpretation 1. rand function 2. srand function 3. Time stamp 2. Random number generator   1. Primary version 2. Advanced version 3. Version with better user experience 1. Implementation of guessing numbers game Gue ...

Posted by Kuraden on Thu, 21 Oct 2021 07:06:19 -0700

C language knowledge points sorting -- 02

1. Preface The content of C language to be recorded today is: scanf() function, variable scope and life cycle, constants, strings, comments, and escape characters. Today's content is quite basic. 2. scanf() function and address fetcher& Knowledge points: Supplementary description of header file "#include < stdio. H >&quot ...

Posted by rimedey on Tue, 19 Oct 2021 20:04:13 -0700

Detailed explanation of one-dimensional array, two-bit array and string array

catalogue Array description Definition of one-dimensional array Initialization of one-dimensional array Definition of two-dimensional array Reference to two-dimensional array elements Multidimensional array Character arrays and strings Character array character string 2D string array Array description Array is one of the construc ...

Posted by kbc1 on Tue, 19 Oct 2021 13:18:35 -0700

STM32F103C8T uses register mode to turn on the water flow lamp

1, Initialization settings of GPIO port: clock configuration, I / O mode setting and maximum rate setting      1. Because the pins to be operated by the water flow lamp are all on the GPIO port, it belongs to the AHB bus according to the system structure diagram, so the reset and time control of the port to be used are ...

Posted by matt1 on Tue, 19 Oct 2021 11:21:23 -0700

c Language Foundation

Catalog 1 Calculate the value of the symbolic function 2 Addition, subtraction, multiplication and division to get started with arithmetic 3Who is the winner   4 Calculating days 5 Score Conversion 1 Calculate the value of the symbolic function For any integer n, the sign(n) function is defined as follow ...

Posted by jaysmyhero on Mon, 18 Oct 2021 09:34:15 -0700

C language learning record -- types, operators and expressions

Variable name Naming restrictions - A name is a sequence of letters and numbers. The first character must be a letter. - Do not underline variable names“_"start. - Distinguish between uppercase and lowercase letters (i.e x And X Are two different names). In traditional C language usage, variable names use lowercase letters, and sy ...

Posted by cyberplasma on Mon, 18 Oct 2021 00:31:21 -0700

Linux network programming learning notes

1. bzero() function: zero the first n bytes of the specified string s. #include <string.h> void bzero(void *s, int n); 2. memset() function: replace the memory unit of the first n bytes pointed to by the pointer variable s with an "integer" c, and directly operate the memory space. It is commonly used for memory initializatio ...

Posted by Anthony1312002 on Sun, 17 Oct 2021 10:05:18 -0700

In place heap sorting

Experimental ReportLab 1, Experiment Name: in place heat sorting 2, Purpose of the experiment: Master the data structure of the largest heap and the characteristics of the structure;It can realize the basic operations of maximum heap, such as construction, insertion, deletion, initialization, memory recovery, etcHeap sorting using maximum he ...

Posted by PJSheltrum on Fri, 15 Oct 2021 23:10:31 -0700