Raspberry Pi library for working with Amperka Octoliner line sensor board
Project description
OctolinerPi
A library for Raspberry Pi to interface with the Amperka Octoliner 8-channel line sensor.
Installation
Open the terminal on your Raspberry Pi and use pip
to install the library:
pip3 install octoliner
If you haven’t enabled I²C support in your Raspbian Linux yet, run the configuration tool to turn it on:
sudo raspi-config
Then: Interfacing Options → I2C → Yes (enable) → Yes (autoload) → <Finish> → Yes (reboot). The setting preserves across reboots.
Testing connection
$ python3 -m octoliner
0
0.5
0.675
0
1
# Ctrl+C to exit
API
Quickstart example:
import time
# Import the class required
# from the library octoliner
from octoliner import Octoliner
# Sensor on the standard bus and address
octoliner = Octoliner()
# Lower sensitivity to 80%
octoliner.set_sensitivity(0.8)
while True:
# Read all channel values
values = [octoliner.analog_read(i) for i in range(8)]
# Print them to console
print(values)
# Repeat forever, twice per second
time.sleep(0.5)
See full API reference in API.md.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
octoliner-2.1.0.tar.gz
(6.3 kB
view hashes)
Built Distribution
octoliner-2.1.0-py3-none-any.whl
(19.5 kB
view hashes)
Close
Hashes for octoliner-2.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04b72ddcfa1ee8afe17572766faf97c06e434fb4a9f63d12ae0c7ab53b4a6ef8 |
|
MD5 | 41febd1da1ccf402d7152b859cbd8ad0 |
|
BLAKE2b-256 | 928aaba8b5644182bbc8edebf25eace062ae692b1c3d88cc8bbfda78b99ff1e9 |