Skip to main content

ADI study watch python SDK

Project description

Study Watch Python SDK

The adi-study-watch provides an object-oriented interface for interacting with ADI's VSM study watch platform.

Installation

pip install adi-study-watch

Description

A user application can use the SDK to receive complete packets of bytes over a physical interface (USB or BLE) and decode it. The functionality is organized into applications, some of which own sensors, some own system-level functionality (i.e. file system), and while others own algorithms. The hierarchy of objects within the SDK mirrors the applications present on the device. Each application has its own object within the SDK hierarchy, which is used to interact with that application. A brief guide on using the SDK and few examples have been added below.

Firmware Setup

https://github.com/analogdevicesinc/study-watch-sdk/blob/main/firmware/Study_Watch_Firmware_Upgrade.pdf

Getting started with SDK

Import the adi-study-watch module into your application code

from adi_study_watch import SDK

Instantiate the SDK object by passing the com port number

sdk = SDK('COM28')

The application objects can be instantiated from the sdk object. In order to instantiate an application object, we'll have to pass a call-back function as an input argument which can be used to retrieve the data from the application object. Define a callback function as displayed below.

def adxl_cb(data):
    print(data)

Once the call-back function is defined, you can instantiate the application object as shown below.

adxl_app = sdk.get_adxl_application()
adxl_app.set_callback(adxl_cb)

Each application object has various methods that can be called by referring to the application. An example of retrieving the sensor status is shown below. Almost all method in an application returns result in a dict.

packet = adxl_app.get_sensor_status() # returns dict
print(packet)

Basic Example:

import time
from adi_study_watch import SDK

# callback function to receive adxl data
def callback_adxl(data):
    for d in data["payload"]["stream_data"]:
        print(d["timestamp"], d["x"], d["y"], d["z"]))


sdk = SDK("COM4")
adxl_application = sdk.get_adxl_application()
adxl_application.set_callback(callback_adxl)
adxl_application.start_sensor()
adxl_application.subscribe_stream()
time.sleep(10)
adxl_application.unsubscribe_stream()
adxl_application.stop_sensor()

All streams packet structure : https://analogdevicesinc.github.io/study-watch-sdk/python/_rst/adi_study_watch.core.packets.html#module-adi_study_watch.core.packets.stream_data_packets

Documentation : https://analogdevicesinc.github.io/study-watch-sdk/python

Examples : https://github.com/analogdevicesinc/study-watch-sdk/tree/main/python/samples

License : https://github.com/analogdevicesinc/study-watch-sdk/blob/main/LICENSE

Changelog 4.0.5 : https://github.com/analogdevicesinc/study-watch-sdk/blob/main/python/changelog_4_0_5.txt

Changelog 4.0.6 : https://github.com/analogdevicesinc/study-watch-sdk/blob/main/python/changelog_4_0_6.txt

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adi_study_watch-4.0.7.tar.gz (68.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

adi_study_watch-4.0.7-py3-none-any.whl (149.2 kB view details)

Uploaded Python 3

File details

Details for the file adi_study_watch-4.0.7.tar.gz.

File metadata

  • Download URL: adi_study_watch-4.0.7.tar.gz
  • Upload date:
  • Size: 68.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.10

File hashes

Hashes for adi_study_watch-4.0.7.tar.gz
Algorithm Hash digest
SHA256 c20da66cc562ce0c0c6c32cf226a1d8f5cdbe02aed654988f128fc437481e0e1
MD5 70743fbdf9895eb7bbf98df6185829e7
BLAKE2b-256 6aee446d81da002aa2c3d67d6782b57bba5e14850c65b5474b5be5d869cf41aa

See more details on using hashes here.

File details

Details for the file adi_study_watch-4.0.7-py3-none-any.whl.

File metadata

  • Download URL: adi_study_watch-4.0.7-py3-none-any.whl
  • Upload date:
  • Size: 149.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.10

File hashes

Hashes for adi_study_watch-4.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d7e2e2a9dab1ee1b8ca67b09e286b60730bf83706800258b28025bd02850909c
MD5 d83f95e51f54428bc192b047ef02fc70
BLAKE2b-256 bca3d9c68bcf97f66aab3522a8ea6debaade6b18fcfc5c3d9a6033c6592d372f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page