Skip to content

Commit

Permalink
Merge pull request #8 from pimoroni/docs-tweak-readme
Browse files Browse the repository at this point in the history
readme and installer tweaks
  • Loading branch information
helgibbons authored Jul 4, 2024
2 parents d8e9784 + 15fc951 commit c292f42
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 9 deletions.
55 changes: 47 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,56 @@
[![PyPi Package](https://img.shields.io/pypi/v/pimoroni-as7343.svg)](https://pypi.python.org/pypi/pimoroni-as7343)
[![Python Versions](https://img.shields.io/pypi/pyversions/pimoroni-as7343.svg)](https://pypi.python.org/pypi/pimoroni-as7343)

Suitable for detecting the properties of ambient light, light passing through a liquid or light reflected from an object the AS7343 spectral sensor has 6 spectral channels at 450 (violet), 500 (blue), 550 (green), 570 (yellow), 600 (orange) and 650nm (red).
AS7343 is a 14-channel multi-purpose spectral sensor. It can detect 14 spectral channels - 12 in the visible spectrum (VIS) to near-infrared (NIR) range, a clear channel and flicker channel.

# Installing
You can buy our AS7343 breakout [here](https://shop.pimoroni.com/products/as7343-14-channel-multi-spectral-sensor-breakout)!

Stable library from PyPi:
## Installing

* Just run `python3 -m pip install pimoroni-as7343`
We'd recommend using this library with Raspberry Pi OS Bookworm or later. It requires Python ≥3.7.

Latest/development library from GitHub:
### Full install (recommended):

* `git clone https://github.com/pimoroni/as7343-python`
* `cd as7343-python`
* `./install.sh --unstable`
We've created an easy installation script that will install all pre-requisites and get your AS7343 breakout up and running with minimal efforts. To run it, fire up Terminal which you'll find in Menu -> Accessories -> Terminal
on your Raspberry Pi desktop, as illustrated below:

![Finding the terminal](http://get.pimoroni.com/resources/github-repo-terminal.png)

In the new terminal window type the command exactly as it appears below (check for typos) and follow the on-screen instructions:

```bash
git clone https://github.com/pimoroni/as7343-python
cd as7343-python
./install.sh
```

**Note** Libraries will be installed in the "pimoroni" virtual environment, you will need to activate it to run examples:

```
source ~/.virtualenvs/pimoroni/bin/activate
```

### Development:

If you want to contribute, or like living on the edge of your seat by having the latest code, you can install the development version like so:

```bash
git clone https://github.com/pimoroni/as7343-python
cd as7343-python
./install.sh --unstable
```

## Install stable library from PyPi and configure manually

* Set up a virtual environment: `python3 -m venv --system-site-packages $HOME/.virtualenvs/pimoroni`
* Switch to the virtual environment: `source ~/.virtualenvs/pimoroni/bin/activate`
* Install the library: `pip install pimoroni-as7343`

In some cases you may need to us `sudo` or install pip with: `sudo apt install python3-pip`.

This will not make any configuration changes, so you may also need to enable:

* i2c: `sudo raspi-config nonint do_i2c 0`

You can optionally run `sudo raspi-config` or the graphical Raspberry Pi Configuration UI to enable interfaces.

5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,7 @@ ignore = [
[tool.pimoroni]
apt_packages = []
configtxt = []
commands = []
commands = [
"printf \"Setting up i2c..\\n\"",
"sudo raspi-config nonint do_i2c 0",
]

0 comments on commit c292f42

Please sign in to comment.