Arduino Uno Quick Start Manual page 263

Hide thumbs Also See for Arduino Uno:
Table of Contents

Advertisement

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
Then load your blinking LED sketch and compile it. (We did this back at the
start of our journey in
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. That s 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, it s 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
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.
There s another difference between Arduino programming and regular C++
code. When programming for the Arduino, you don t define
because it is already defined in the libraries provided by the Arduino develop-
ers. As you might have guessed, it calls
function in a loop. Since Arduino 1.0, it also calls
loop function.
Further restrictions when programming C++ on AVR microcontrollers include
1
the following:
• You cannot use the Standard Template Library (STL) because it s way too
big for the small AVR microcontrollers.
• Exception handling isn t supported. That s why you see the
switch often when the
• Dynamic memory management using
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 there s no excuse for sloppy coding!
1.
http://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_cplusplus
Appendix 2. Advanced Arduino Programming
Changing Preferences, on page
Changing Preferences, on page
setup
avr-gcc
compiler is invoked.
new
www.it-ebooks.info
26).
avrdude
in action. This tool is
main
first and then runs the
serialEvent
at the end of the
-fno-exceptions
and
delete
isn t supported.
250
26.
yourself,
loop
report erratum
discuss

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Subscribe to Our Youtube Channel

Table of Contents