EasyManuals Logo

Arduino uno User Manual

Arduino uno
311 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #263 background imageLoading...
Page #263 background image
you should turn on a more verbose output, so you can see all command-line
tool invocations. Enable verbose output for both compilation and upload in
the Preferences menu, as described in Changing Preferences, on page 26.
Then load your blinking LED sketch and compile it. (We did this back at the
start of our journey in Changing Preferences, on page 26).
The command invocations look weird at first because of the names of the
many temporary files that are created. You should still be able to identify all
compile and link steps necessary to build even a simple sketch like our
blinking LED example. Thats the most important thing the Arduino team
did: they hid all these nasty details well behind the IDE, so even people with
no software development experience can program the Arduino. For program-
mers, its a good idea to work in verbose mode, because the best way to learn
about all the AVR tools is to see them in action.
Upload the program to the Arduino now to see
avrdude
in action. This tool is
responsible for loading code into the Arduino and can be used for programming
many other devices, too. Interestingly, the AVR tools even make it possible
to use the Arduino IDE for non-Arduino projects.
Theres another difference between Arduino programming and regular C++
code. When programming for the Arduino, you dont define
main
yourself,
because it is already defined in the libraries provided by the Arduino develop-
ers. As you might have guessed, it calls
setup
first and then runs the
loop
function in a loop. Since Arduino 1.0, it also calls
serialEvent
at the end of the
loop function.
Further restrictions when programming C++ on AVR microcontrollers include
the following:
1
You cannot use the Standard Template Library (STL) because its way too
big for the small AVR microcontrollers.
Exception handling isnt supported. Thats why you see the
-fno-exceptions
switch often when the
avr-gcc
compiler is invoked.
Dynamic memory management using
new
and
delete
isnt supported.
In addition to all that, you should keep an eye on performance. C++ automat-
ically creates a lot of functions (copy constructors, assignment operators, and
so on) in the background that are rarely needed on the Arduino. Even with
these restrictions, the Arduino supports a powerful subset of the C++ program-
ming language. So theres no excuse for sloppy coding!
1.
http://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_cplusplus
Appendix 2. Advanced Arduino Programming 250
report erratum discuss
www.it-ebooks.info

Table of Contents

Other manuals for Arduino uno

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Arduino uno and is the answer not in the manual?

Arduino uno Specifications

General IconGeneral
Form factorArduino
CertificationRoHS, FC, CE
Processor model-
Processor frequency- MHz
Microcontroller modelATmega328
Microcontroller frequency16 MHz
DC input voltage7-12 V
Operating voltage5 V
DC current per I/O pin40 mA
Flash memory0.032 MB
Maximum internal memory- GB
SRAM (Static Random Access Memory)2 KB
EEPROM (Electrically Erasable Programmable Read-Only Memory)1 KB
Wi-FiNo
Number of analog I/O pins6
Number of digital I/O pins14
Weight and Dimensions IconWeight and Dimensions
Board dimensions53.4 x 68.6 mm

Related product manuals