File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 22 * @file constants.h
33 * @author José Ángel Sánchez (https://github.com/gelanchez)
44 * @brief Constants used along the program
5- * @version 1.0.0
6- * @date 2020-08-22
5+ * @version 1.0.1
6+ * @date 2020-08-28
77 * @copyright GPL-3.0
88 */
99
1414
1515namespace Constants
1616{
17+ const long serialBaud (9600 ); // bps for Serial.begin
18+
1719 // MOTORS
1820 // Right motors pins
1921 const uint8_t motorsEnA (6 );
Original file line number Diff line number Diff line change 22 * @file robot.cpp
33 * @author José Ángel Sánchez (https://github.com/gelanchez)
44 * @brief Library for controling the robot.
5- * @version 1.0.1
6- * @date 2020-08-23
5+ * @version 1.0.2
6+ * @date 2020-08-28
77 * @copyright GPL-3.0
88 */
99
@@ -47,7 +47,7 @@ void RobotControl::restartState()
4747
4848void RobotControl::begin ()
4949{
50- Serial.begin (9600 ); // Can not be inside a constructor
50+ Serial.begin (Constants::serialBaud ); // Can not be inside a constructor
5151 m_servo.begin (); // Servo initialization can not be done inside Robot constructor
5252}
5353
@@ -56,7 +56,6 @@ String RobotControl::getBTData()
5656 String dataBT = " " ;
5757 while ((Serial.available () > 0 ) && (dataBT.endsWith (" }" ) == false ))
5858 {
59-
6059 dataBT += static_cast <char >(Serial.read ());
6160 delay (3 );
6261 }
@@ -298,7 +297,6 @@ void RobotControl::lineTrackingMode()
298297 m_state = RobotModeState::OBSTACLE;
299298 }
300299 break ;
301-
302300 case RobotModeState::LINELOST:
303301 m_motors.rotateRight (); // Rotate 180 and find the line
304302 delay (Constants::rotate180Time);
You can’t perform that action at this time.
0 commit comments