Programming Arduino Getting Started with Sketches


Figure 2-7 Modifying the Blink sketch The Arduino Application



Yüklə 5,42 Kb.
Pdf görüntüsü
səhifə14/78
tarix22.12.2023
ölçüsü5,42 Kb.
#189286
1   ...   10   11   12   13   14   15   16   17   ...   78
Arduino SimonMonk 2011

Figure 2-7
Modifying the Blink sketch
The Arduino Application
Sketches in Arduino are like documents in a word processor. You can open them and copy
parts from one to another. So you see options to Open, Save, and Save As in the File
menu. You will not normally use Open because the Arduino application has the concept of
a Sketchbook where all your sketches are kept carefully organized into folders. You gain
access to the Sketchbook from the File menu. As you have just installed the Arduino
application for the first time, your Sketchbook will be empty until you create some
sketches.
As you have seen, the Arduino application comes with a selection of example sketches
that can be very useful. Having modified the Blink example sketch, if you try and save it,
you get a message that says, “Some files are marked read-only so you will need to save
this sketch in a different location.”
Try this now. Accept the default location, but change the filename to MyBlink, as
shown in 
Figure 2-8
.
Now if you go to the File menu and then click on Sketches, you will see MyBlink as
one of the sketches listed. If you look at your computer’s file system, on a PC, you will
find that the sketch has been written into My Documents\Arduino, and on Mac or Linux,
they are in Documents/Arduino.
All of the sketches used in this book can be downloaded as a zip file
(Programming_Arduino.zip) from 
www.arduinobook.com
. I suggest that now is the time
to download this file and unzip it into the Arduino folder that contains the sketches. In
other words, when you have unzipped the folder, there should be two folders in your
Arduino folder: one for the newly saved MyBlink and one called Programming Arduino
(see 
Figure 2-9
). The Programming Arduino folder will contain all the sketches, numbered
according to chapter, so that sketch 03-01, for example, is sketch 1 of 
Chapter 3
.


Figure 2-8
Saving a copy of Blink
These sketches will not appear in your Sketchbook menu until you quit the Arduino
application and restart it. Do so now. Then your Sketchbook menu should look similar to
that shown in 
Figure 2-10
.

Yüklə 5,42 Kb.

Dostları ilə paylaş:
1   ...   10   11   12   13   14   15   16   17   ...   78




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin