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

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.

主站蜘蛛池模板: 隆昌县| 遵义县| 金沙县| 长葛市| 合作市| 涟水县| 鄂温| 孝感市| 阜南县| 兰坪| 罗江县| 乳源| 哈尔滨市| 金阳县| 凯里市| 大悟县| 确山县| 巫溪县| 布拖县| 隆德县| 普定县| 西畴县| 乳山市| 上饶市| 通许县| 墨竹工卡县| 基隆市| 芷江| 栾川县| 舞阳县| 永昌县| 余庆县| 宜春市| 开江县| 新丰县| 临夏市| 商都县| 康保县| 交城县| 丰县| 莱阳市|