Example Code for UNIHIKER K10 - Motor Driver
Control 180° and 360° servos to learn PWM output basics.
Hardware Preparation
- UNIHIKER K10 * 1
- Multi Function Expansion Board for UNIHIKER * 1
- Micro Metal Gear Motor with Connector * 1
Note: The multi-functional expansion board requires separate power supply when IN use. It can be powered by installing an 18650 battery or from the USB IN of the expansion board, and the PWR power supply switch needs to be turned on.
Software Preparation
If Using Mind+
- Mind+ Download
- Mind+ User Extension: https://github.com/YeezB/ext-UnihikerExpansion
If Using Arduino IDE
- Arduino IDE Download
- Arduino library: https://github.com/dfrobot/DFRobot_UnihikerExpansion
Hardware Connection

Use UNIHIKER K10 & Mind+

Use UNIHIKER K10 & Arduino IDE
#include "DFRobot_UnihikerExpansion.h"
DFRobot_UnihikerExpansion_I2C eunihiker(&Wire);
void setup()
{
Serial.begin(115200);
while(!eunihiker.begin()){
Serial.println("NO Deivces !");
delay(1000);
}
eunihiker.setMotorPeriod(eMotor1_2, 255);
eunihiker.setMotorPeriod(eMotor3_4, 255);
}
void loop()
{
eunihiker.setMotorDuty(eMotor1_A, 200);
eunihiker.setMotorDuty(eMotor1_B, 0);
delay(3000);
eunihiker.setMotorDuty(eMotor1_A, 0);
eunihiker.setMotorDuty(eMotor1_B, 200);
delay(3000);
}
UNIHIKER K10 Result

Was this article helpful?
