<p>Hi guys,</p>
<p>I need to hook up a Raspberry PI to AD / DA converters and I would like to use GO to talk to these converters.</p>
<p>I have accured this board:</p>
<p><a href="http://www.waveshare.com/high-precision-ad-da-board.htm" rel="nofollow">http://www.waveshare.com/high-precision-ad-da-board.htm</a></p>
<p>and I understand that I need to build on top of a library like emdb or go-rpio, but I'm completelly lost on how it is actually done. Is there a library or description of what and how should I send to the pins and how to read back? Is it somehow standard between all the chips, or each specific model of AD/ DC requires special commands and protocols?</p>
<p>I found some articles on how to use another AD converter - ADS1115, but they all basically say "take this library call this method" and I don't think it will work for any other chip but ADS1115 specifically.</p>
<p>On top of all that, I'm kinda uneasy to do anything I don't understand as I suspect it will just fry the board.</p>
<p>Could someone help me out? I would appreciate any input. If there is any other way to add another AD / DC to raspberry running with GO I would be glad to explore that too.</p>
<p>Thanks</p>
<hr/>**评论:**<br/><br/>albgr03: <pre><p>Unfortunately, every converters works differently, so yes, it will work for one or two models.</p>
<p>I used Go to work with an ADS1015 a few months ago. It uses an I²C interface, so you don't have to worry about RPi's GPIO if you're running Linux. You just have to wire it to the Pi like described <a href="https://learn.adafruit.com/raspberry-pi-analog-to-digital-converters/ads1015-slash-ads1115" rel="nofollow">here</a>.</p>
<p>I've modified <a href="https://github.com/adafruit/Adafruit_ADS1X15" rel="nofollow">Adafruit's Arduino library for ADS1x15</a> to use Linux API, then translated it to Go. I still have the library itself, but I can't find any working example on my computer.</p></pre>AAOEM: <pre><p>Should I search for these specific converter spec or what would that be called - api, interface? </p>
<p>I understand that i2c is done on emdb or go-rpio level and you already have it all included, so you can operate pin voltage from the api, but what bits are going to what pin is defined by how a convertor wants it. Or it's even more complicated than that?</p></pre>albgr03: <pre><blockquote>
<p>Should I search for these specific converter spec or what would that be called - api, interface? </p>
</blockquote>
<p>Yes. It should be described in the datasheet.</p>
<blockquote>
<p>I understand that i2c is done on emdb or go-rpio level and you already have it all included</p>
</blockquote>
<p>Actually, it's done by Linux, which exposes a device in /dev</p>
<blockquote>
<p>but what bits are going to what pin is defined by how a convertor wants it. Or it's even more complicated than that?</p>
</blockquote>
<p>The way bits are transmitted in I²C is standard, so you don't need to worry about that.</p>
<p>Well, a little bit in fact. I²C is based on registers. Each slaves have registers, and a master can read and write in those. They have to be called with the device address and the register address. Those are specific to the chip, and should be described in the component's datasheet too.</p></pre>AAOEM: <pre><p>Would anyone know any DA AD converters for Raspberry that have a working Go library support?</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传