How to get started with embedded C language? How do I program a microcontroller? Introduction In this C language course, we’ll learn how to program to control embedded systems.This course is aimed at people who are not familiar with electronic board programming in C.This course can also be very useful for those who have already made programs in C but want to focus more on hardware: knowing which types of variables take up the least space in memory, or how to switch on an LED. Which interpreter should you use? To program, we’ll use microchip’s MPLAB IDE software to simulate and download the program directly onto the circuit board.If you’d like to program electronic boards easily, especially Arduino boards, take a look at our courses on the Arduino language. C language basics We’re now going to take a look at the basics of the C language to get you started.a) Void mainLa première chose que l’on voit quand on ouvre un programme est le void main : #include <stdio.h> void main(){ //Your progam } The main function is the main function of your program. This is where you put all the program instructions or function calls you need.The void main is mandatory, as failure to include it will result in an error.b) Square bracketsEvery function starts with an open bracket ({) and ends with a closed bracket (}): #include <stdio.h> void main(){ my_function(); } void my_function { } Failure to use the square brackets will result in an error.c) SemicolonThe last thing we’re going to look at is the semicolon. In the C language, all instructions always end with a semicolon: #include <stdio.h> void main(){ my_function(); // We call the my_function which is an intruction so semicolon } void my_function { } Failure to use a semicolon will result in an error. Small quiz We’ll now take a short quiz to test your knowledge of the C language.1) What is a library?A) A pre-written source file containing ready-to-use functionsB) A file containing function names, their signatures and the type of return codeC) A file containing a program2) What is a console-mode program?A) A program that runs only on the system consoleB) A program that runs on a virtual terminal in a graphical windowC) A program that runs in a graphical environment with windows3) Which function displays text on the screen in console mode?A) Serial.println(“message”);B) printf(“message”);C) fprintf(“message”);4) Which symbol is used to make a line break?A) \aB) \rC) \n5) What’s the name of the program that translates your C-language code into binary?A) The programmerB) The interpreterC) The compiler6) When declaring a variable, which memory is used?A) The hard diskB) MicroprocessorC) RAM7) Which of these variables will cause an error?A) jujuB) juju-5C) juju_58) Which data type can store -89?A) intB) unsigned intC) double9) What is the correct line to retrieve a decimal number entered from the keyboard?A) scanf(“%f”,decimal_number);B) scanf(“%lf”, *decimal_number);C) scanf (%f” ,&decimal_number);10) Which function can be used to round 2.75 to 2?A) CeilB) RoundC) Pow Quiz correction Here are the answers to the quiz: 1)A), 2)A) , 3)B), 4)c), 5)c), 6)C), 7)B), 8)A), 9)C), 10)B).Don’t worry if you had trouble answering the questions, you can take a look at our Embedded C language courses, which will help you with your programming!