Include

From Microduino Wiki
Revision as of 09:29, 4 August 2016 by Fengfeng (talk) (Created page with "*'''#include ''' #include is used to fetch external libraries to your sketch, which makes the programmer access to a huge integration of standard C libraries (predefined funct...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
  • #include
  1. include is used to fetch external libraries to your sketch, which makes the programmer access to a huge integration of standard C libraries (predefined functions sets).

The main reference manual page of AVR C library(AVR is a standard of chip Atmel, on which Arduino is based)is here.

Pay attention to that #include has no semicolon terminator , similar to #define. If you add a semicolon, the compiler will trigger odd errors.

  • Example

This program includes a library which is used to output data to the flashmemory of the program space, rather than the memory, which will save storage space for dynamic memory needing and make creating huge lookup table more realizable.


#include <avr/pgmspace.h>

prog_uint16_t myConstants[] PROGMEM = {0, 21140, 702  , 9128,  0, 25764, 8456,
0,0,0,0,0,0,0,0,29810,8968,29762,29762,4500};


[Return to Arduino Syntax Manual]