Contents
Introduction
This DC motor shield can be assembled on Arduino Uno compatible development kit.
Block Diagram

Lab setup
Platform IO Coding
wire.h is not recognized at first, so, inside “platformio.ini,” lib_deps = Wire needs to be included to avoid an error when main.cpp was complied.
- lib_deps = Wire, TLE94122


Arduino Coding Explanation
-
Header Files
- #include <TLE94112.h>
- #include <Tle94123Motor.h>
- #include <tle94112_conf.h>
-
TLE Object
- Tle94112 controller = Tle94112();
-
Tle94112 Motor Objects
- Tle94112 Motor motor1(controller);
- Tle94112Motor motor2(controller);
-
void setup()
// Enable MotorController Tle94112// Note: Required to be done before starting to configure the motorcontroller.begin();// Connect motor1 to HB1 and HB2motor1.connect(motor1.HIGHSIDE, controller.TLE_HB1);motor1.connect(motor1.LOWSIDE, controller.TLE_HB2);// Drive HB1 with signal from PWM1// Note: This allows to control the speed of the motormotor1.setPwm(motor1.HIGHSIDE, controller.TLE_PWM1);// Set PWM Frequency, default is 80 Hzmotor1.setPwmFreq(motor1.HIGHSIDE, controller.TLE_FREQ100HZ);//when configuration is done, call begin to start operating the motorsmotor1.begin();
-
void loop()
// start the motor1 forwards on half speed
motor1.start(127);
// accelerate motor1 to full speed
motor1.setSpeed(255);
// Stop motor1
motor1.stop(255);
References
- DC Motor Shield TLE94112EL: weblink
- TLE94112EL Chip datasheet: weblink
- Arduino Source Code Example: Github weblink