Thames & Kosmos Code Gamer Experiment Manual page 22

Coding workshop ? game with kosmobits
Table of Contents

Advertisement

PROJECT 4
!
▲ Another type of library
20
CodeGamer manual inside english.indd 20
// white
red = 255;
green = 255;
blue
= 255;
pixel.setColor(red, green, blue, brightness);
delay(500);
}
SOFTWARE LIBRARIES
To avoid having to reinvent the wheel with every
program, there are software libraries. These are not
book collections. Instead, they contain reusable
program functions and definitions. There are some
libraries that provide mathematical functions, while
there are others to make it easy to use certain types of
hardware such as sensors or NeoPixels. To be able to use
the tools that this kind of library can make available to
you, you have to include the corresponding library in
your own program.
You do this with the help of the
#include <KosmoBits_Pixel.h>
KosmoBits_Pixel library, for example. Some libraries,
however, use functions from other libraries. They have to
be additionally included, such as in the KosmoBits_Pixel
library. More specifically, in order to work they require
the Adafruit_NeoPixel library, which is linked via
#include <Adafruit_NeoPixel.h>
</>
instruction:
#include
includes the
.
7/19/16 12:32 PM

Advertisement

Table of Contents
loading

Table of Contents