官术网_书友最值得收藏!

Arduino Sketch

When we program the Arduino, the code is put into a project. These projects are called sketches and a sketch is stored in a Sketchbook. A sketch is designed to be as simple and straightforward as possible by abstracting away a lot of the technical aspects of programming the Arduino by using the prebuilt functions.

The coding language used to program the Arduino is very similar to the C programming language. We will be looking at how to program the Arduino in Chapter 6, Programming the Arduino – The Basics and Chapter 7, Programming the Arduino – Beyond the Basics. This chapter is to get you familiar with what sketches are and to look at the tools we can use.

Before a sketch can be uploaded to an Arduino, the Arduino IDE or Web Editor must go through several steps to build the application. The first step to building a sketch is to perform some preprocessing, which turns the sketch into a C++ (see-plus-plus) program, which is passed to the compiler to turn this human-readable C++ code into machine-readable instructions (object files). These object files are then linked against the standard Arduino libraries that provide the basic functionality for the Arduino. The results of this linking are a single hex file that can be uploaded to the Arduino and ran. The nice thing is the Arduino tools perform all of this automatically when we tell them to upload the sketch to the Arduino board.

If we were to put a definition on what an Arduino Sketch is, we would say that it is the project that contains the human-readable code that can be built and uploaded to an Arduino. Now let's look at two tools that we can use to help us write and build these sketches, starting with the Arduino IDE.

主站蜘蛛池模板: 广汉市| 合水县| 措勤县| 介休市| 南投县| 台江县| 安仁县| 泌阳县| 裕民县| 雷波县| 永新县| 饶阳县| 连州市| 多伦县| 吴旗县| 洛宁县| 石台县| 华阴市| 潢川县| 陈巴尔虎旗| 伊宁县| 即墨市| 南川市| 陈巴尔虎旗| 团风县| 简阳市| 波密县| 旅游| 喀喇沁旗| 定兴县| 巴彦县| 开封县| 谷城县| 新蔡县| 松溪县| 大丰市| 滦平县| 温宿县| 五河县| 通化市| 台东县|