Cover image
Try Now
2019-08-12

Une bibliothèque Arduino prenant en charge la série MCP3xxx de puces ADC SPI, y compris MCP3002, MCP3004, MCP3008 et autres.

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
  • Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.

  • ShrimpingIt
  • Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX

  • jae-jae
  • MCP Server pour récupérer le contenu de la page Web à l'aide du navigateur sans tête du dramwright.

  • ravitemer
  • Un puissant plugin Neovim pour gérer les serveurs MCP (Protocole de contexte modèle)

  • patruff
  • Pont entre les serveurs Olllama et MCP, permettant aux LLM locaux d'utiliser des outils de protocole de contexte de modèle

  • pontusab
  • La communauté du curseur et de la planche à voile, recherchez des règles et des MCP

  • av
  • Exécutez sans effort LLM Backends, API, Frontends et Services avec une seule commande.

  • WangRongsheng
  • 🧑‍🚀 全世界最好的 LLM 资料总结 (数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Résumé des meilleures ressources LLM du monde.

  • Mintplex-Labs
  • L'application tout-en-un desktop et Docker AI avec chiffon intégré, agents AI, constructeur d'agent sans code, compatibilité MCP, etc.

  • appcypher
  • Serveurs MCP géniaux - une liste organisée de serveurs de protocole de contexte de modèle

    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!