Vous êtes sur la page 1sur 2

AGFP.

txt
old to attend. These roads can be redirected by reprogramming the FPGA, and therefore provide a
great advantage to individuals who understand the city blueprints (or
necessary knowledge to reprogram). Microcontrollers are different in that they are predefined by the
manufacturer (or city architect) and instead of reprogramming the
entire city, the maker can reprogram the traffic lights. This often makes projects more manageable
as creative individuals without a large technical background only need
to tell the cars where they want them to go.
Thankfully, most makers will not have to worry about coding if their project mimics another project
found in the vast online database of microcontroller creations. Most
makers are very generous and post their example code, which can be easily edited following a few
coding basics. An example of a basic project code is provided as
Image 2 (above) and the original code can be found in Step 3 of this Monster Box Instructable.
Commentary in the margins of Image 2 explains how to read some of the
common elements found in provided project codes.
When beginning a code, the basic coding elements you may run across include: a library reference,
variable definitions, a setup function, a loop function, and userdefined functions. Each code you run across may present each of these elements differently than
the provided example, so it is important to ask the author questions if
the coding components dont make sense. Below you can read about what each of these functions
contribute to a basic project code.
A Library Reference: Indicates what materials may be required for running the code. In the example
code, the library reference specifies the use of a servo, whose
function is explained in the following code elements.
Variable Definitions: This list defines how each action performed by the code will be referenced (i.e.
what each action will be called). The example code in Image 2
provides in depth explanations of each action in the green annotations on the right.
Setup Function: The setup function explains what happens when power is first connected to your
project. This function is what starts your project moving and precedes
the loop function, only happening once while the project is powered. It will repeat each time you
power your project, but never repeat following the loop function.
Loop Function: If your project requires a repeating action, the loop function will define what is
repeated. How the repetition is performed will be listed in the user-defined
functions (coming up next). The provided example code uses a loop function to repeat servo
movements over a specified time period.
User-Defined Functions: These define the actions taking place during the loop function, such as
what happens when certain phrases are listed. In the example code the
user-defined functions state what happens when openMouth and closedMouth functions are
referenced (i.e. the servo moves a specified amount of degrees to change
the box lid angle).
By using these coding elements, you can edit a provided project code with any board the system
recognizes. To learn more about what boards are recognized by each
software system, please read on to Step 3 in this Instructable.
Soldering: A way to connect your electrical communication components so that circuits can be
completed.
Page 1

AGFP.txt
Depending on the type of project you are attempting to make, soldering can be a useful skill to
understand and use. Many projects may only require the use of jumper
wires, such as the Monster Box example project, but there are some projects that require greater
connective power. In these circumstances, soldering is used to connect
project components that necessitate conductive properties. Unlike alternative bonding mechanisms,
solder can be reheated and is conducive to minor corrections if
mistakes are made. The general process is fairly inexpensive, making it ideal for makers who are
working on personal projects, and it is well documented online (check
out a popular soldering Instructable here). You will need to invest in some startup materials when
beginning to solder, like the basic soldering setup in Image 3, so it is
important to review online documentation to find out what your project might require (such as this
Instructable describing the different types of soldering tips you might
use).

Page 2

Vous aimerez peut-être aussi