请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:ADS122C04EVM 您好!
感谢您对电路板设置的帮助。 我现在尝试使用 EVM 读取连接到微控制器的负载单元输出。 我的是 Arduino uno。 我已经如你所说的那样建立连接、但是我很难找到能够支持简单读取 ADC 的代码。 我找不到带有地址等的示例代码。 如果您知道这一点、那将非常有帮助。
谢谢
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
您好!
感谢您对电路板设置的帮助。 我现在尝试使用 EVM 读取连接到微控制器的负载单元输出。 我的是 Arduino uno。 我已经如你所说的那样建立连接、但是我很难找到能够支持简单读取 ADC 的代码。 我找不到带有地址等的示例代码。 如果您知道这一点、那将非常有帮助。
谢谢
尊敬的 Eitan:
社区中应有一些可供您使用的基本 I2C Arduino 代码示例。 下面是一些可能有助于您入门的代码:
#include <Wire.h> Wire.begin(); // join i2c bus (address optional for master) Wire.beginTransmission(device); // start communcation with device (48...4B) Wire.write(0B00000001); Wire.write(highByte(setupdevice)); // Set I2C address to device (48...4B) Wire.write(lowByte(setupdevice)); Wire.endTransmission(); Wire.beginTransmission(device); /// start communcation with device (48...4B) Wire.write(0B00000000); Wire.endTransmission(); Wire.requestFrom(device, 2); // request 2 bytes from slave device #2 byte a = Wire.read(); byte b = Wire.read(); word code=(a*256)+b;
此致、
鲍勃 B