English | 繁體中文
Description
This library provides functions to communicate with an AD7606 ADC using an ESP8266 board (such as NodeMCU). It utilizes hardware SPI to read 8 channels of data from the AD7606, allowing you to easily retrieve voltage measurements.
Features
- Hardware SPI reading from AD7606
- Customizable SPI frequency, bit order, and mode
- Simple offset threshold (scaleFactor & errorConst)
- Helper function to print all 8 channel voltages at once
- Download or clone this repository.
- Place the folder
AD7606-ADC-Sensor-Library-for-ESP8266into thelibrariesfolder of your Arduino installation. - Restart the Arduino IDE (or click Sketch > Include Library > Add .ZIP Library if you have a ZIP file).
- In your sketch, add
#include <AD7606_ESP8266.h>. - Create an
AD7606_ESP8266object. - Call
setPins()if needed to specify custom pins (otherwise default pins are used). - Call
setSPISettings()if you need different SPI parameters (default is 1MHz, MSBFIRST, SPI_MODE0). - Call
begin()to initialize the device. - Use
readData()andparseRawBytes()to read data, then retrieve voltage withgetVoltage(channel), or useprintAllVoltages()to print all channels.
See the example in examples/BasicRead/BasicRead.ino for a quick start.
This project is released under the MIT License - see the LICENSE file for details.
