This is a Python library for controlling and communicating with the FSRray device. This library provides high-level interfaces to handling data from an FSR (Force-Sensitive Resistor) array via serial port.
This package uses setuptools for distribution. You can install it via pip:
pip install pyFSRray
or directly from the source code:
git clone https://github.com/Aightech/pyFSRray.git
cd pyFSRray
python setup.py install
- Python 3.6+
- socket (from the Python Standard Library)
- logging (from the Python Standard Library)
import time
from FSRray import FSRray
def callback(values, dt):
print("dt = {}".format(dt))
print("values = {}".format(values))
fsrray = FSRray()
fsrray.set_callback(callback)
fsrray.connect()
time.sleep(10)
fsrray.disconnect()
FSRray(width=16, verbose=False)
: This is the constructor for the FSRray class.set_callback(callback)
: Sets the callback function which is invoked with the latest data from the FSR array.connect(path="/dev/ttyACM0", baud=500000, timeout=3)
: Connects to the FSR array via the serial port.disconnect()
: Disconnects from the FSR array.
Feel free to submit a pull request if you want to contribute to this project.
This library is distributed under the MIT License. Please see the LICENSE file for more information.
If you have any questions or run into any problems, please open an issue in the GitHub repository.
Use this software at your own risk. The authors are not responsible for any damage that may be caused directly or indirectly through the use of this software.