MCP cover image
See in Github
2017-07-05

与MCP3221 I2C ADC接口的库和驱动程序。包括通过移动平均线平滑,累积移动平均值和指数移动平均值

2

Github Watches

7

Github Forks

10

Github Stars

Welcome To: SW_MCP3221 Driver Library

Note: This can be used with any AVR/Arduino that needs to interface with hardware that is based on an MCP3221

Updated: 2017, July renamed to separate from the other library

Originally written as a simple interface this driver has been extended with a couple simple averaging methods, and makes taking readings very easy. This class is extended by the MiniLib class which uses this and a few other interfaces extensively!

Class Info

  • Simple implementation with instancing (MCP3221 mcp3221(address,vref) for example)
  • Feed it address and and measured VREF(I.E measured VDD into IC)

Method Info

  • readI2CADC, takes a single reading from the MCP3221 which is in constant conversion mode by default(IIRC its always in this mode)
  • calcMillivolts, calls readI2CADC and uses VREF value that was input during instance creation
  • calcRollingAVG, Takes current raw adc reading and adds it to a storage array(default is 10 data points), th oldest data point is dropped and array is shifted to move with readings
  • calcEMAVG, approximates a rolling average by using an ALPHA coefficient and a power of 2 POWER for division, only needs a current reading which is weighted by ALPHA is pass through
  • updateVRef in case a class which inherits from this one can update the vref should it be necessary

Average and Smoothing Info

Quick list of Smoothing methods used in this driver
  • Rolling/Moving average, uses an array to store data points, oldest is removed and current reading is added in as array is shifted to move with dataset
  • Exponential moving average using power of 2 division(POWER) to avoid unnecessary float math, approximates a moving average while only using current data point
  • Number of rolling average samples have been increased to 20 will wait to see if this is adequate or not.

License Info

Creative Commons License
MCP3221 Library by Ryan Edwards, Sparky's Widgets is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

相关推荐

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

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

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

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

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

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

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

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

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

  • Lists Tailwind CSS classes in monospaced font

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

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

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

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

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

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

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

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

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

  • n8n-io
  • 具有本机AI功能的公平代码工作流程自动化平台。将视觉构建与自定义代码,自宿主或云相结合,400+集成。

  • open-webui
  • 用户友好的AI接口(支持Ollama,OpenAi API,...)

    Reviews

    1 (1)
    Avatar
    user_H0BJAqy3
    2025-04-17

    The MCP3221-Library by SparkysWidgets is a fantastic tool for interfacing with the MCP3221 ADC. The code is clean, well-documented, and easy to integrate into existing projects. I highly recommend it for anyone needing precise ADC functionality. Great job, SparkysWidgets! Check it out here: https://github.com/SparkysWidgets/MCP3221-Library