Skip to content

Py Getting Started

jaenrig-ifx edited this page Apr 16, 2021 · 2 revisions

Getting Started with Python framework on Raspberry Pi

This page explains how to install and use the Python wrapper for the multi half bridge library with the TLE94112ES HAT for Raspberry Pi.

Overview

Required experience

  • Experience level: Moderate
  • Basic linux user level
  • Basic programming skills: Python

Required Hardware

Name Picture
DC Motor Control HAT with TLE94112ES
Compatible Raspberry Pi
8GB+ microSD card for Raspberry Pi
5.5V - 20V power supply with > 15W
Compatible DC motor

Required Software

Tutorial

Hardware Setup

The TLE94112ES HAT needs to be stacked onto a compatible Raspberry Pi. A jumper needs to be placed between the middle pin and the CS0 marking as shown in the picture.

The DC Motor Control HAT with TLE94112ES follows the Raspberry Pi HAT specification and can be stacked onto any 40-pin Raspberry Pi.

  • Stack the DC Motor Control HAT onto the Raspberry Pi.
  • Connect a 5.5 to 20V power supply to the Vcc and GND pin of the DC Motor Control HAT
  • Connect a DC Motor or another load of your choice to output 1 and 5 of the controller

Note ⚠️ : Make sure to connect the power supply only to the designated inputs of your DC Motor Control HAT and that it doesn't exceed 20V. Otherwise your hardware can be damaged.

Raspberry Pi setup

Set up Raspberry Pi with Raspberry Pi OS or similar OS. Check this page for instructions.

You can access your Raspberry Pi either using a monitor and a keyboard or using SSH in a headless setup as described here.

Now insert the microSD card into your Raspberry Pi and turn on the power supply to boot it up. The Raspberry Pi will be powered by the DC Motor Control HAT.

Library installation

This library can be installed easily using pip. If you do not have pip installed please do so by typing

sudo apt-get install python3-pip

into the command line of your Raspberry Pi. Afterwards you can install the Infineon multi half bridge library by typing

sudo pip3 install multi-half-bridge

Clone the repository

Once the library is installed clone the multi half bridge repository.

git clone https://github.com/Infineon/multi-half-bridge.git

Navigate to the example folder

cd multi-half-bridge/src/framework/raspberrypi/examples_py

and execute the examples from the terminal:

sudo python3 basicTest.py
Clone this wiki locally