Maqueen V3 and Unihiker K10

userHead NDY 2025-09-09 07:58:02 136 Views2 Replies

I am trying to wirite some block code in Mind+ for the Maqueen V3 with a Unihiker K10 for Obstacle Avoidance. There is an example in the Community area but it doesn't seem to work.

 

Has anyone suceeded in making Obstacle Avoidance with this hardware.

 

Thanks

Chris

2025-09-11 01:51:27  

The “Maqueen V3” extension in Mind+ is officially built around micro:bit firmware, not Unihiker.

When you drag “avoid obstacle” blocks, Mind+ assumes a micro:bit is driving the motors directly. On Unihiker, you must map the motor control to the K10’s GPIO/I²C bus instead.

 

Even if the ultrasonic works, the robot might not move if the K10 isn’t actually commanding the motors correctly.

userHeadPic ahsrab.rifat
2025-09-10 09:00:54

After many tries, I think I did it:

 

/*!
* MindPlus
* esp32s3bit
*
*/
#include <DFRobot_MaqueenPlusV2.h>
#include <DFRobot_matrixLidarDistanceSensor.h>
// Create an object
DFRobot_MaqueenPlusV2                 maqueenPlus;
uint8_t                               tofAddress = 0x33;
DFRobot_matrixLidarDistanceSensor_I2C tof(tofAddress);


// Main program start
void setup() {
maqueenPlus.sys_int();
tof.begin();
tof.getAllDataConfig(eObstacle);
tof.configAvoidance(160);
maqueenPlus.set_rgbLed(2, 0x00FF00);
}
void loop() {
tof.requestObstacleSensorData();
if (((tof.getDir())==3)) {
 maqueenPlus.set_rgbLed(2, 0x00FF00);
 maqueenPlus.motorRun(maqueenPlus.ALL, maqueenPlus.CW, 130);
}
if (((tof.getDir())==2)) {
 maqueenPlus.set_rgbLed(0, 0xFF0000);
 maqueenPlus.motorRun(maqueenPlus.LEFT, maqueenPlus.CW, 130);
 maqueenPlus.motorRun(maqueenPlus.RIGHT, maqueenPlus.CCW, 130);
}
if (((tof.getDir())==1)) {
 maqueenPlus.set_rgbLed(1, 0xFF0000);
 maqueenPlus.motorRun(maqueenPlus.LEFT, maqueenPlus.CCW, 130);
 maqueenPlus.motorRun(maqueenPlus.RIGHT, maqueenPlus.CW, 130);
}
}
 

userHeadPic NDY