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

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.

主站蜘蛛池模板: 同江市| 遵义市| 福州市| 通辽市| 雷州市| 景宁| 武宁县| 白玉县| 寻甸| 调兵山市| 垫江县| 融水| 拜泉县| 天峨县| 曲阳县| 南昌县| 新乡县| 新乡县| 修武县| 黄冈市| 沙洋县| 尼木县| 庆城县| 克拉玛依市| 内乡县| 永安市| 灯塔市| 吉木乃县| 彭阳县| 图木舒克市| 长子县| 汉沽区| 巩义市| 台中市| 治县。| 灵寿县| 临朐县| 苗栗县| 垦利县| 尼木县| 丹东市|