
3) Installing variAnt’s Library
We prepared an Arduino library that will make
controlling your ant easy.
Start by downloading the current file,
VariAnt.zip
, at
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...
2)
Open the
VariAnt.zip
file you downloaded.
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
and use
Sketch/Include Library/VariAnt
or write the
following at the beginning of the program:
#include <VariAnt.h>
The variAnt library manages the movements of
your robot ant as well as the sensor polling and
LED indicators.
It includes two subordinate objects of the class
AntMotor, which handle the control of the left
and right motors using the reed switches.
VariAnt.h
AntMotor.h
VariAnt.cpp
AntMotor.cpp
The VariAnt Library has 2 data files for each of the
classes, VariAnt and AntMotor.
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.
Summary of Contents for variAnt
Page 1: ...Version 230825...
Page 38: ...C Appendix 1 Overview of the Components...
Page 39: ...2 Schematic Diagram of the variAnt Board...
Page 40: ......