diff --git a/inc/drivers/cutebot/Cutebot.h b/inc/drivers/cutebot/Cutebot.h index 47df950..b9fbd87 100644 --- a/inc/drivers/cutebot/Cutebot.h +++ b/inc/drivers/cutebot/Cutebot.h @@ -9,10 +9,10 @@ // Reference: https://github.com/elecfreaks/pxt-cutebot -#define CUTEBOT_PERIOD_LINE_SENSORS 500 -#define CUTEBOT_START_COUNT_LINE_SENSORS 300 -#define CUTEBOT_PERIOD_DISTANCE_SENSOR 500 -#define CUTEBOT_START_COUNT_DISTANCE_SENSOR 100 +#define CUTEBOT_PERIOD_LINE_SENSORS 100 +#define CUTEBOT_START_COUNT_LINE_SENSORS 0 +#define CUTEBOT_PERIOD_DISTANCE_SENSOR 100 +#define CUTEBOT_START_COUNT_DISTANCE_SENSOR 50 // I2C address of the Cutebot const char CUTEBOT_I2C_ADDR = 0x10 << 1; diff --git a/inc/drivers/cutebot/CutebotMotor.h b/inc/drivers/cutebot/CutebotMotor.h index 5029f11..4245213 100644 --- a/inc/drivers/cutebot/CutebotMotor.h +++ b/inc/drivers/cutebot/CutebotMotor.h @@ -6,8 +6,8 @@ #include "inc/drivers/Motor.h" enum CutebotMotorId { - CUTEBOT_MOTOR_ID_RIGHT = 1, - CUTEBOT_MOTOR_ID_LEFT, + CUTEBOT_MOTOR_ID_LEFT = 1, + CUTEBOT_MOTOR_ID_RIGHT, }; class CutebotMotor : public Motor diff --git a/source/drivers/cutebot/CutebotLineSensors.cpp b/source/drivers/cutebot/CutebotLineSensors.cpp index 93f70a1..abc2eb1 100644 --- a/source/drivers/cutebot/CutebotLineSensors.cpp +++ b/source/drivers/cutebot/CutebotLineSensors.cpp @@ -12,12 +12,12 @@ CutebotLineSensors::CutebotLineSensors(MicroBitIO &_io) : io(_io), readings {0, uint16_t CutebotLineSensors::getLeftReading() { - return this->readings[1]; + return this->readings[0]; } uint16_t CutebotLineSensors::getRightReading() { - return this->readings[0]; + return this->readings[1]; } void CutebotLineSensors::idleTick()