Maze_Solver  1.0
A Maze Solver Algorithm for BotnRoll ONE A
Robot.h
Go to the documentation of this file.
1 #ifndef ROBOT_H
2 #define ROBOT_H
3 
4 #if defined(ARDUINO) && ARDUINO >= 100
5 #include "Arduino.h"
6 #else
7 #include "WProgram.h"
8 #endif
9 
10 #include "NonLinearControl.h"
11 #include <BnrOneA.h>
12 #include "Intersection.h"
13 
14 class Robot
15 {
16  public:
18  Robot();
19 
21 
26  void init();
27 
29 
32  bool areThereObstacles();
33 
35 
38  void sendToMotors(MoveType robotMove, char lineSignature);
39 
41 
45  void EEPROMWriteInt(int p_address, int p_value);
46 
48 
52  unsigned int EEPROMReadInt(int p_address);
53 
55  void writeEEPROM();
56 
58  void readEEPROM();
59 
61  void readQTR8A(unsigned int* line);
62 
64  int readLineSensors(unsigned int* sensor_values);
65 
67  void Menu();
68 
69  BnrOneA _one;
70  int _speed;
73  bool _debug;
74  int _pause;
76 };
77 
78 #endif /* ROBOT_H */
int _pause
the pause in milliseconds for 90º fixed turnings
Definition: Robot.h:74
Definition: NonLinearControl.h:18
MoveType
Admissible movements.
Definition: Path.h:11
unsigned int EEPROMReadInt(int p_address)
Reads an integer from the EEPROM.
Definition: Robot.cpp:108
void Menu()
Launches the Menu for User Interface.
Definition: Robot.cpp:134
Definition: Robot.h:14
int _leftWheelSpeed
the left wheel speed
Definition: Robot.h:71
int _speed
the reference speed of the robot
Definition: Robot.h:70
BnrOneA _one
the interface to the Bot'n Roll One A
Definition: Robot.h:69
bool areThereObstacles()
Reads IR obstacles sensors and sends commands to motors avoiding obstacles.
Definition: Robot.cpp:30
NonLinearControl _nonLinearControl
Non-linear control values.
Definition: Robot.h:75
void readQTR8A(unsigned int *line)
Read the calibrated line Sensor.
Definition: Robot.cpp:213
void writeEEPROM()
Reads all the saved values from the EEPROM (e.g. speed and other parameters)
Definition: Robot.cpp:116
void readEEPROM()
Stores all the relevant values on the EEPROM (e.g. speed and other parameters)
Definition: Robot.cpp:125
Robot()
creates an instance of the class Robot
Definition: Robot.cpp:10
int readLineSensors(unsigned int *sensor_values)
Read the line Sensor.
Definition: Robot.cpp:221
void init()
Configures the robot to be used with Bot'n Roll One.
Definition: Robot.cpp:15
void EEPROMWriteInt(int p_address, int p_value)
Writes an integer to the EEPROM.
Definition: Robot.cpp:99
int _rightWheelSpeed
the right wheel speed
Definition: Robot.h:72
bool _debug
when true sends debug messages to LCD/Serial interface
Definition: Robot.h:73
void sendToMotors(MoveType robotMove, char lineSignature)
Sends commands to motors.
Definition: Robot.cpp:54