Download Print this page

Variobot variAnt Instructions Manual page 30

Advertisement

3) Installing variAnt's Library
We prepared an Arduino library that will make
controlling your ant easy.
Start by downloading the current file,
https://www.variobot.com/variant
This is how you can install the library in the
Arduino-IDE:
1)
In the menu, click
Sketch/Include Library/Add .ZIP Library...
VariAnt.zip
2)
Open the
The Arduino IDE automatically installs the library in
the correct "libraries" folder. Before using it, you
may need to restart the Arduino IDE.
To access the variAnt functions in your program
(Sketch), the library has to be included in your
Sketch. To do that, you can either go to the menu
Sketch/Include Library/VariAnt
and use
following at the beginning of the program:
#include <VariAnt.h>
VariAnt.zip
file you downloaded.
or write the
The variAnt library manages the movements of
your robot ant as well as the sensor polling and
LED indicators.
, at
It includes two subordinate objects of the class
AntMotor, which handle the control of the left
and right motors using the reed switches.
The VariAnt Library has 2 data files for each of the
classes, VariAnt and AntMotor.
VariAnt.h
VariAnt.cpp
The so-called header files (.h) only have the
declarations of the variables and functions.
The C++ (.cpp) files contain the actual
implementation of those specific functions.
Since the class AntMotor cannot be accessed
directly through your Sketch, its functions are
rather irrelevant for you.
AntMotor.h
AntMotor.cpp

Advertisement

loading
Need help?

Need help?

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