Download the PHP package volantus/mcp3008 without Composer
On this page you can find all versions of the php package volantus/mcp3008. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download volantus/mcp3008
More information about volantus/mcp3008
Files in volantus/mcp3008
Package mcp3008
Short Description PHP library for reading values from the A/D converter MCP3008
License GNUv3
Informations about the package mcp3008
MCP3008 PHP library
PHP library for reading values from the A/D converter MCP3008
Dependencies
The library requires one of the following dependencies to be installed:
- berry-spi extension: Native direct communication
- volantus/php-pigpio composer library: For using Pigpio daemon socket
Installation
The library may be installed using Composer:
Usage
All measurements are done through the Reader class.
The constructor requires an SpiInterface object and the ADC reference voltage, which is 3.3 per default on Raspberry.
Using Pigpio daemon (socket)
If you want to use the native SPI channels (recommended), you may use the RegularSpiDevice
:
If you want to use any other GPIO Pins instead, please use the BitBaningSpiDevice
:
Using direct communication via berry-spi extension:
If you want to use the native SPI channels (recommended), you may use the RegularInterface
:
If you want to use any other GPIO Pins instead, please use the BitBangingInterface
:
Reading values
Reading values is done by channel and value is returned as Measurement
object:
SPI Opening/Closing behaviour
Per default the reader opens the SPI interface in the constructor and closes it in the destructor. But only if needed, so you are free to control it by yourself:
Contribution
Contribution in form of bug reports, suggestions or pull requests is highly welcome!