Skip to main content

[BETA]Supporting python package for use with the Blino PiNaps Raspberry pi hat.

Project description

#PiNaps Supporting Library

This library provides comprehensive, high level control of the PiNaps Raspberry Pi hat.

##Installation

###Step 1

Install I2C chip driver SC16IS750.py Install pinaps for PiNaps Hat

##Usage

There are two main classes the library provides. The PiNapsController is for controlling the PiNaps hardware. The BlinoParser is used for parsing/processing the data retrieved from the TGAT sensor on the PiNaps.

###PiNapsController

Use the PINapsController to setup how the PiNaps operates. This includes functions for powering the TGAT and on-board LED, retrieving data from the TGAT over UART or I2C and setting the TGAT operating mode.

###BlinoParser

Use the BlinoParser class to process bytes retrieved from the TGAT sensor. There are two methods for working with the parsed information.

####Returning Packets The parseByte function returns the latest packet. It is advisable to check with a conditional that the packet has been updated before using it. This is advised as not every iteration a byte is parsed is new information updated in the packet. Check the object's "updated" member variable.

####Callbacks There are a set of callback functions which when defined are executed when the associated information is parsed. Define these to use the information as desired.

####Getters Additionally at any time the latest information can be retrieved from the BlinoParser object using getters.

##Examples

###Blinky This example is used to show the PiNaps is provided with power and its on-board LED is functioning.

###Logging This example demonstrates the data logging functionality to a local log file and prints the debug information to the console.

###Returning Packets This example demonstrates the use of the returned packets from the parsing function. The function currently returns the latest formed packet every byte passed. However, a check is made to discover if the packet has been updated since the last byte was passed.

###Callbacks This example demonstrates the definition of the parsers callbacks. In doing this, the user can choose how each piece of information is processed as it is parsed.

###Command Bytes This example demonstrates how the TGAT mode can be configured using the PiNaps controller functions. In this example the command bytes are controlled by the user using the console to input the desired mode to transition to.

###BlinoPlotter This example demonstrates a simple graph plot of the EEG data retrieved in real time using the matplotlib pyplot (https://matplotlib.org)

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

pinaps-0.3.tar.gz (5.9 kB view hashes)

Uploaded Source

Built Distribution

pinaps-0.3-py2-none-any.whl (6.5 kB view hashes)

Uploaded Python 2

Supported by

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