Cover image
Try Now
2019-08-12

一个支持MCP3XXX系列ADC SPI芯片的Arduino库,包括MCP3002,MCP3004,MCP3008等。

3 years

Works with Finder

2

Github Watches

4

Github Forks

20

Github Stars

MCP3XXX

Build Status

Description

An Arduino Library supporting the MCP3XXX series of ADC SPI chips, including MCP3002, MCP3004, MCP3008 and others.

Features

MCP3XXX is a simple library enabling access to the MCP3XXX series of ADC SPI chips. Support for differential and psuedo-differential reads. Supports MCP3002, MCP3004 and MCP3008. Support for 12 and 13 bit chips such as MCP3202, MCP3204, MCP3208 and MCP3304 will be added when they can officially tested. When not reading data, the chip goes into standby / low power mode. On the MCP3004/3008, for example the standby current is only 5 nA.

Background

Why do I need this? You need additional analog inputs.

Setup

Basic

To read from analog input 0 on an MCP3002 using the default hardware SPI pins, you might use:

#include <MCP3XXX.h>

// Create an instance of the MCP3002 ADC.
MCP3002 adc;

void setup()
{
  Serial.begin(9600);

  // Use the default SPI hardware interface.
  adc.begin();
}

void loop()
{
  // Read from channel 0 and print.
  Serial.print(adc.analogRead(0));
  delay(10);
}

Documentation

See API Documentation.

Troubleshooting

If you encounter connection issues, confirm that the maximum sampling frequency you are using is supported by voltage of your board. For example, the aliases MCP3002, MCP3004, MCP3008 are defined as:

// A typedef for the MCP3002.
// Max clock frequency for 2.7V: 1200000 Hz
// Max clock frequency for 5.0V: 3200000 Hz
typedef MCP3XXX_<10, 2, 1200000, 2> MCP3002;

// A typedef for the MCP3004.
// Max clock frequency for 2.7V: 1350000 Hz
// Max clock frequency for 5.0V: 3600000 Hz
typedef MCP3XXX_<10, 4, 1350000> MCP3004;

// A typedef for the MCP3008.
// Max clock frequency for 2.7V: 1350000 Hz
// Max clock frequency for 5.0V: 3600000 Hz
typedef MCP3XXX_<10, 8, 1350000> MCP3008;

Thus, higher voltage boards allow a higher sampling rate.

Examples

See the included examples for further usage options.

Developer Notes

Currently the library has been tested with MCP3002 and MCP3008. MCP3004 support is also included because it uses the same SPI command structure as the MCP3008.

Datasheets

Changelog

See CHANGELOG.md.

License

See LICENSE.md.

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • Lists Tailwind CSS classes in monospaced font

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • https://appia.in
  • Siri Shortcut Finder – your go-to place for discovering amazing Siri Shortcuts with ease

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • tomoyoshi hirata
  • Sony α7IIIマニュアルアシスタント

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

  • ravitemer
  • 一个功能强大的Neovim插件,用于管理MCP(模型上下文协议)服务器

  • patruff
  • Ollama和MCP服务器之间的桥梁,使本地LLMS可以使用模型上下文协议工具

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

  • appcypher
  • 很棒的MCP服务器 - 模型上下文协议服务器的策划列表

    Reviews

    3 (1)
    Avatar
    user_eHxE1aeX
    2025-04-18

    I've been using the MCP3XXX series by bakercp and it has tremendously streamlined my embedded projects. The library is robust, well-documented, and integrates seamlessly with various microcontroller platforms. It's evident that a lot of thought and care went into its development. Highly recommend for anyone looking to enhance their projects with reliable ADC functionality. Check it out on GitHub!