Cover image
Try Now
2019-08-12

Eine Arduino -Bibliothek, die die MCP3XXX -Serie von ADC -SPI -Chips unterstützt, darunter MCP3002, MCP3004, MCP3008 und andere.

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.

  • 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.

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

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

  • 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
  • Entdecken Sie die umfassendste und aktuellste Sammlung von MCP-Servern auf dem Markt. Dieses Repository dient als zentraler Hub und bietet einen umfangreichen Katalog von Open-Source- und Proprietary MCP-Servern mit Funktionen, Dokumentationslinks und Mitwirkenden.

  • jae-jae
  • MCP -Server für den Fetch -Webseiteninhalt mit dem Headless -Browser von Dramatikern.

  • ravitemer
  • Ein leistungsstarkes Neovim -Plugin für die Verwaltung von MCP -Servern (Modellkontextprotokoll)

  • patruff
  • Brücke zwischen Ollama und MCP -Servern und ermöglicht es lokalen LLMs, Modellkontextprotokoll -Tools zu verwenden

  • pontusab
  • Die Cursor & Windsurf -Community finden Regeln und MCPs

  • av
  • Führen Sie mühelos LLM -Backends, APIs, Frontends und Dienste mit einem Befehl aus.

  • WangRongsheng
  • 🧑‍🚀 全世界最好的 llm 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Zusammenfassung der weltbesten LLM -Ressourcen.

  • Mintplex-Labs
  • Die All-in-One-Desktop & Docker-AI-Anwendung mit integriertem Lappen, AI-Agenten, No-Code-Agent Builder, MCP-Kompatibilität und vielem mehr.

  • appcypher
  • Awesome MCP -Server - eine kuratierte Liste von Modellkontext -Protokollservern für Modellkontext

    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!