Download Print this page

AcSiP AI7688H Reference Manual page 54

Advertisement

10.4 Using UPM in Python
UPM is an open source sensor and peripheral driver repository based on
libmraa APIs. Among the popular sensor drivers such as I2C accelerometers
and many others are available from this repository.
AI7688H system image is pre-installed with UPM and you can start
programming on existing sensors immediately – but if the default
implementation is not available, you can use opkg package manager to
update the UPM library.
UPM comes with bindings in C++, Python and Node.js. Let's get started with
an example where you'll learn how to use UPM and Python to receive
values from an I2C accelerometer – a Grove 3-Axis Digital Accelerometer
(±16g).
Connect the accelerometer to your board. You can connect the pins from
the accelerometer to the corresponding pins GND, 3V3, SDA and SCL on
AI7688H. Import pyupm_adxl345 module from the UPM repository in your
program, you'll do this in the next step. This module is used because the
Grove 3-Axis Digital Accelerometer (±16g) uses the ADXL345 chipset.
Create a Python script adxl.py with following content
Execute the Python script in system console by typing the following
command:
-50-
Document Name
AI7688H
Reference Manual
Version
V 2.0
Date
2019/08/08

Advertisement

loading

This manual is also suitable for:

Ek-ai7688h