
MCP4728
Arduino-Bibliothek für MCP4728 Quad-Kanal, 12-Bit-Spannungsausgang Digital-Analog-Konvertor mit nichtflüchtigem Speicher und i2c kompatibler serieller Schnittstelle
6
Github Watches
6
Github Forks
25
Github Stars
MCP4728
Arduino library for MCP4728 quad channel, 12-bit voltage output Digital-to-Analog Convertor with non-volatile memory and I2C compatible Serial Interface
This library is highly inspired from this great work
Usage
#include <Wire.h>
#include "MCP4728.h"
MCP4728 dac;
void setup()
{
Serial.begin(115200); // initialize serial interface for print()
Wire.begin();
dac.attach(Wire, 14);
dac.readRegisters();
dac.selectVref(MCP4728::VREF::VDD, MCP4728::VREF::VDD, MCP4728::VREF::INTERNAL_2_8V, MCP4728::VREF::INTERNAL_2_8V);
dac.selectPowerDown(MCP4728::PWR_DOWN::GND_100KOHM, MCP4728::PWR_DOWN::GND_100KOHM, MCP4728::PWR_DOWN::GND_500KOHM, MCP4728::PWR_DOWN::GND_500KOHM);
dac.selectGain(MCP4728::GAIN::X1, MCP4728::GAIN::X1, MCP4728::GAIN::X2, MCP4728::GAIN::X2);
dac.analogWrite(MCP4728::DAC_CH::A, 111);
dac.analogWrite(MCP4728::DAC_CH::B, 222);
dac.analogWrite(MCP4728::DAC_CH::C, 333);
dac.analogWrite(MCP4728::DAC_CH::D, 444);
dac.enable(true);
dac.readRegisters();
printStatus();
delay(5000);
}
void loop()
{
static int count = 0;
if (++count > 4000) count = 0;
dac.analogWrite(count, count, count, count);
delay(10);
dac.readRegisters();
printStatus();
}
void printStatus()
{
Serial.println("NAME Vref Gain PowerDown DACData");
for (int i = 0; i < 4; ++i)
{
Serial.print("DAC");
Serial.print(i, DEC);
Serial.print(" ");
Serial.print(" ");
Serial.print(dac.getVref(i), BIN);
Serial.print(" ");
Serial.print(dac.getGain(i), BIN);
Serial.print(" ");
Serial.print(dac.getPowerDown(i), BIN);
Serial.print(" ");
Serial.println(dac.getDACData(i), DEC);
Serial.print("EEPROM");
Serial.print(i, DEC);
Serial.print(" ");
Serial.print(dac.getVref(i, true), BIN);
Serial.print(" ");
Serial.print(dac.getGain(i, true), BIN);
Serial.print(" ");
Serial.print(dac.getPowerDown(i, true), BIN);
Serial.print(" ");
Serial.println(dac.getDACData(i, true), DEC);
}
Serial.println(" ");
}
License
MIT
相关推荐
I find academic articles and books for research and literature reviews.
Confidential guide on numerology and astrology, based of GG33 Public information
Advanced software engineer GPT that excels through nailing the basics.
Converts Figma frames into front-end code for various mobile frameworks.
Take an adjectivised noun, and create images making it progressively more adjective!
Siri Shortcut Finder – your go-to place for discovering amazing Siri Shortcuts with ease
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.
Die All-in-One-Desktop & Docker-AI-Anwendung mit integriertem Lappen, AI-Agenten, No-Code-Agent Builder, MCP-Kompatibilität und vielem mehr.
Ein leistungsstarkes Neovim -Plugin für die Verwaltung von MCP -Servern (Modellkontextprotokoll)
MCP -Server für den Fetch -Webseiteninhalt mit dem Headless -Browser von Dramatikern.
Brücke zwischen Ollama und MCP -Servern und ermöglicht es lokalen LLMs, Modellkontextprotokoll -Tools zu verwenden
🧑🚀 全世界最好的 llm 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Zusammenfassung der weltbesten LLM -Ressourcen.
Fair-Code-Workflow-Automatisierungsplattform mit nativen KI-Funktionen. Kombinieren Sie visuelles Gebäude mit benutzerdefiniertem Code, SelbstHost oder Cloud, 400+ Integrationen.
Reviews

user_Hv9nyazP
I'm thoroughly impressed with the MCP4728 by hideakitai. This DAC library is excellently crafted for precise control and smooth performance. Integrating it into my projects has been effortless, thanks to its intuitive design and detailed documentation available on GitHub. Highly recommend it for anyone needing reliable DAC functionality.