How to add new .c, .h files to the generated keil file to write a new control module

1. First, right-click the row where the core is located to generate the following options 

 

2.选中Add New item to Group'XXX'

3. After clicking, an option box like this will appear.Select the file type you want to generate. I can’t understand the previous words, .c, You should know about .h files. .c is the core code. , for example, main.c file, .h file is Its corresponding header file, a module must have two files, .c and .h. For example, my motor driver module above has two files. Here is an example of generating a .c file< /span>

 

 4. After selecting the file type you want to generate, name your file, select the storage location and click Add. Generate a new .c file, and the .h file is generated similarly.

5. Okay, then we have successfully generated a .c file. You can see that there is already a sensor.c file in the file list on the left. The horizontal list above also has an empty file named sensor.c. The following is You can start writing code. Here Xiao Feng suggests try not to use Chinese when naming the file, otherwise it may be very troublesome in the future

Guess you like

Origin blog.csdn.net/m0_64854963/article/details/131094840