Arduino Nano 读取ADS1100实例
利用Arduino Nano的wire库可以很方便对ADS1100进行设置和读取转换后的数据。
/*
* Arduino reads ADS1100 I2C 16bit diff ADC
*/ /*
SDA ==> analog 4 PC4
SCL ==> analog 5 PC5 set register: STBY 0 0 SC DR1 DR0 PGA1 PGA0
default 1 0 0 0 1 1 0 0 0x8C
i want 1 0 0 0 1 1 0 0
ign 0 0 con 8SPS GAIN 1
STBY, only for single mode to start conversion
SC 1= single , 0=continuous
DR1:0 datarate 00 = 128sps, 12 bit -2048 to 2047
01 = 32sps, 14 -8192 to 9191
10 = 16sps, 15 -16384 to 16383
11 = 8sps, 16 -32768 to 32767
PGA1:0 Gain 00 = *1, 01 = *2, 10 = *4, 11 = *8
*/ #include <Wire.h> // AD0 1001 000 r/w AD1 1001 001 r/w ; r=1. w=0
#define AD0 B1001000 // ADS1100 地址0x48
#define options B10001100 // 0x8C-- 8SPS,16位精度,1倍放大 uint8_t reg = ;
int16_t result = ; void setup() {
Serial.begin();
Wire.begin();
Wire.beginTransmission(AD0);
Wire.write(options);
Wire.endTransmission();
} void loop() {
Wire.beginTransmission(AD0);
Wire.requestFrom(AD0, ); // 返回 3个 bytes
while(Wire.available()) {
result = Wire.read();
result = result << ;
result += Wire.read();
reg = Wire.read();
Serial.print(result, DEC);
Serial.println("\t");
Serial.print((3300.00 * result)/ 0x7FFF, 2);//ADS1100接3.3V电源,如果接5V要将3300.00改为5000.00
Serial.println(" mV");
}
Wire.endTransmission();
delay();
}
Arduino Nano 读取ADS1100实例的更多相关文章
- Arduino + RFID 读取 IC 卡 Arduino uno中获得RFID的UID 并通过串口转发RFID卡号
RFID简介:射频识别即RFID(Radio Frequency IDentification)技术,又称无线射频识别,是一种通信技术,可通过无线电讯号识别特定目标并读写相关数据,而无需识别系统与特定 ...
- Arduino Nano + WIZ550io = 简易上网
我爱Arduino Nano – 这是一个非常好外形小巧却功能齐全的Arduino Uno.然而.当我去将它连接到互联网,全部的干净利落小巧也消失在大尺寸的以太网盾底下了. 只是,我近期发现了一个更好 ...
- 使用Arduino Nano驱动Lora模块
使用Arduino Nano驱动Lora模块 为什么选用Lora 射频通信芯片有很多种,但是一般在同样功耗下,距离没有Lora远;同等范围下,没有Lora节能. Lora通信只适用于低速率,高延时的场 ...
- Arduino nano的bootloader文件烧录
1.买了了nano还没用就用 avrisp烧录器给烧了其他程序,仅仅是的avr单片机了:2.将他恢复成Arduino nano吧. 在Arduino软件安装目录中的hardware\arduino中. ...
- PMS5003ST+Arduino Nano 串口读取数据
先上代码: 库文件是在guihub上的大神写的https://github.com/jbanaszczyk,我拿来小改下用以支持5003ST #include <Arduino.h> #i ...
- PMS5003ST+Arduino Nano OLED屏显示
整合OLED显示和PMS5003报数 #include <Arduino.h> #include <pms.h> /////////////////////////////// ...
- C#读取对象实例的值和对对象的属性自动赋值方法
using System; using System.Data; using System.Reflection; namespace DBUtility { /// <summary> ...
- php对mysql简单读取的实例
读取mysql数据库 例. <?php $link=mysql_connect("localhost","root","之前的管理员密码& ...
- Java开发之I/O读取文件实例详解
在java开发或者android开发中,读取文件是不可避免的,以下对java开发中读取文件做了归纳和详解: 1.按字节读取文件内容2.按字符读取文件内容3.按行读取文件内容 4.随机读取文件内容 pa ...
随机推荐
- [OpenCV Qt教程] 在Qt图形界面中显示OpenCV图像的OpenGL Widget(第二部分)
本文译自:http://www.robot-home.it/blog/en/software/tutorial-opencv-qt-opengl-widget-per-visualizzare-imm ...
- linux 监控系统剩余内存大小
cur_free = `free -m | awk '/buffers\// {print $NF}'` chars="current memory is $cur_free." ...
- Nginx服务优化
1.1Nginx.conf配置文件基本参数优化 1.1.1 隐藏nginx header内版本号信息 一些特定的系统及服务漏洞一般都和特定的软件及版本号有关,我们应尽量隐藏服务器的敏感信息(软件名称 ...
- 一个进程间同步和通讯的 C# 框架
转自原文 一个进程间同步和通讯的 C# 框架 threadmsg_demo.zip ~ 41KB 下载 threadmsg_src.zip ~ 65KB 下载 0.背景简介 微软在 .NE ...
- C# 强制删除文件,解除占用的几点思考
有一个古老的传说: 占用的文件是可以被强制删除的... 如果被别的应用程序打开着,你就要先找到那个打开的程序,结束掉才行.或者关闭关闭相关进程,延迟的方法. 一般来说被占用就意味着有其它进行或者线程对 ...
- leetcode382
/** * Definition for singly-linked list. * public class ListNode { * public int val; * public ListNo ...
- Delphi 画箭头
procedure TForm1.Line(x, y, x2, y2: integer); begin canvas.MoveTo(x, y); canvas.LineTo(x2, y2); end; ...
- MySQL group_concat_max_len
MySQL提供的group_concat函数可以拼接某个字段值成字符串,如 select group_concat(user_name) from sys_user,默认的分隔符是 逗号,即" ...
- Lists、Sets、Maps和Collections2的使用
1.Lists //Lists System.out.println("### Lists ###"); ArrayList<String> arrayList = L ...
- 移动端web页面input限制只能输入数字
<input type="number" pattern="[0-9]*" /> 如上所示,在安卓端设置input类型为number,可限制键盘只输 ...