A Beginner’s Guide to Microcontroller Programming — Understanding the Structure of C Code Files Using main.c/.h as an Example

“ This article serves as preparatory content for beginners in microcontroller development, explaining the structure of C language code files using main.c/.h as an example, to help newcomers quickly understand C language for microcontroller programming.” There are only two types of C language code files: source files with a .c suffix and header files with … Read more

CMake Basics: Compiling Multiple Source Files Together

CMake Basics: Compiling Multiple Source Files Together

1. Multiple source files add.c and subtract.c are in one folder, the file structure is as follows:head.h #ifndef _HEAD_H #define _HEAD_H // Add int add(int a, int b); // Subtract int subtract(int a, int b); #endif add.c #include <stdio.h> #include "head.h" // Add int add(int a, int b) { return a + b; } subtract.c … Read more