AlphaBot2 library for Arduino Uno microcontroller for RoboMac Junior 2022.
RoboMac is a robotics and artificial intelligence competition held at the Faculty of Electrical Engineering and Information Technologies (FEEIT) in Skopje, North Macedonia. The goal of the Junior section of the competition is to allow for high school students in their final year of studies to gain experience and insight into new fields such as robotics, electronics, programming, artificial intelligence and increase their interest for these rapidly developing technologies.
The purpose of the library is to allow for easy and natural programming of the AlphaBot2, without a need for extensive experience in C++ programming or Arduino.
This function should always be called in the void setup() function of the Arduino IDE, as it initializes basic pins for the sensors and motors, the OLED display, RGB diodes as well as the Serial Monitor.
Input: None Output: None
This function is for setting a custom colour for each of the RGB diodes on the back of the AlphaBot2.
Input: Four integer arrays containing three values for R, G, and B, for each of the four diodes Output: None
This function is for reading the value of the ultrasonic sensor placed on the front of the AlphaBot2.
Input: Boolean value for printing result (true/false) Output: Approximate distance to obstacle given in centimeters
This function is for reading the front-facing infrared sensors for obstacle detection on the AlphaBot2.
Input: Boolean value for printing results (true/false) Output: Character representing which sensor/s is/are active ('L' - left, 'R' - right, 'B' - both, 'N' - none)
This function is for reading the values of the bottom infrared sensors intended for line following. If calibrated properly, the individual sensor output should be equal to 0 when there is no line detected, and close to 1000 when the line is directly under the sensor.
Input: Boolean value for printing results (true/false) Output: Integer pointer pointing to an array containing the values for all five infrared sensors
This function is for calibrating the bottom infrared sensors intended for line following. The values printed after the calibration should be exchanged for the already used values in the initialize() function.
Input: None Output: None
This function is for making the AlphaBot2 move forward with a given speed (maximum of 180, for safety).
Input: Integer value for speed Output: None
This function is for making the AlphaBot2 move backward with a given speed (maximum of 180, for safety).
Input: Integer value for speed Output: None
This function is for making the AlphaBot2 turn left with a given speed (maximum of 180, for safety).
Input: Integer value for speed Output: None
This function is for making the AlphaBot2 turn right with a given speed (maximum of 180, for safety).
Input: Integer value for speed Output: None
This function is for stopping any movement of the AlphaBot2.
Input: None Output: None
This function is for setting the speed of ONLY the left motor, without changing the speed of the right motor (maximum of 180, for safety).
Input: Integer value for speed Output: None
This function is for setting the speed of ONLY the right motor, without changing the speed of the left motor (maximum of 180, for safety).
Input: Integer value for speed Output: None