资源简介
上传.7z
代码片段和文件信息
//////////////////////////////////////////////////////////////////////////////////////////
//
// Arduino Library for ADS1292R Shield/Breakout
//
// Copyright (c) 2017 ProtoCentral
//
// This software is licensed under the MIT License(http://opensource.org/licenses/MIT).
//
// THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND EXPRESS OR IMPLIED INCLUDING BUT
// NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER LIABILITY
// WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Requires g4p_control graphing library for processing. Built on V4.1
// Downloaded from Processing IDE Sketch->Import Library->Add Library->G4P Install
//
/////////////////////////////////////////////////////////////////////////////////////////
#include
#include
#include
char* ads1292r::ads1292_Read_Data()
{
static char SPI_Dummy_Buff[10];
digitalWrite(ADS1292_CS_PIN LOW);
for (int i = 0; i < 9; ++i)
{
SPI_Dummy_Buff[i] = SPI.transfer(CONFIG_SPI_MASTER_DUMMY);
}
digitalWrite(ADS1292_CS_PIN HIGH);
return SPI_Dummy_Buff;
}
void ads1292r::ads1292_Init()
{
// start the SPI library:
SPI.begin();
SPI.setBitOrder(MSBFIRST);
//CPOL = 0 CPHA = 1
SPI.setDataMode(SPI_MODE1);
// Selecting 1Mhz clock for SPI
SPI.setClockDivider(SPI_CLOCK_DIV16);
ads1292_Reset();
delay(100);
ads1292_Disable_Start();
ads1292_Enable_Start();
ads1292_Hard_Stop();
ads1292_Start_Data_Conv_Command();
ads1292_Soft_Stop();
delay(50);
ads1292_Stop_Read_Data_Continuous(); // SDATAC command
delay(300);
ads1292_Reg_Write(ADS1292_REG_CONFIG1 0x00); //Set sampling rate to 125 SPS
delay(10);
ads1292_Reg_Write(ADS1292_REG_CONFIG2 0b10100000); //Lead-off comp off test signal disabled
delay(10);
ads1292_Reg_Write(ADS1292_REG_LOFF 0b00010000); //Lead-off defaults
delay(10);
ads1292_Reg_Write(ADS1292_REG_CH1SET 0b01000000); //Ch 1 enabled gain 6 connected to electrode in
delay(10);
ads1292_Reg_Write(ADS1292_REG_CH2SET 0b01100000); //Ch 2 enabled gain 6 connected to electrode in
delay(10);
ads1292_Reg_Write(ADS1292_REG_RLDSENS 0b00101100); //RLD settings: fmod/16 RLD enabled RLD inputs from Ch2 only
delay(10);
ads1292_Reg_Write(ADS1292_REG_LOFFSENS 0x00); //LOFF settings: all disabled
delay(10);
//Skip register 8 LOFF Settings default
ads1292_Reg_Write(ADS1292_REG_RESP1 0b11110010); //Respiration: MOD/DEMOD turned only phase 0
delay(10);
ads1292_Reg_Write(ADS1292_REG_RESP2 0b00000011); //Respiration: Calib OFF respiration freq defaults
delay(10);
ads1292_Start_Read_Data_Continuous();
delay(10);
ads1292_Enable_Start();
}
void ads1
相关资源
- 64款大屏大数据可视化看板原型设计
- xshell6.7z
- plc-analyzer5.rar
- SzeliskiBookComputerVisionANDAlgorithmsandAppl
- 雷达手册.pdf
- 爱快ap.zip
- EBatPrint13.2注册破解版_CAD批量打印和批
- R语言实战第2版_完整版带目录.pdf
- 前端+后台源码.zip
- vuforia-unity-6-2-10.unitypackage
- 大话数据结构.pdf.zip
- CFA+2020+Level+II+-+SchweserNotes.zip
- 史上最简单Linux、Windows批量管理工具
- Nginx核心知识全套课件.rar
- 百面_机器学习.pdf
- 以图搜图20170615.rar
- GPS测量原理与应用第三版.pdf
- U盘加密系统.zip
- zhijiao_143730.rar
- Swift_Apprentice_v5.0.0.zip
- arta1.90.rar
- depotTools.zip
- 火车头采集器v7.6企业版永久破解版
- 父与子的编程之旅.zip
- SVID_20180610_225104.zip
- 凸优化——中文影印版.pdf
- zw_-于博士SI設計手記.zip
- 电动汽车动力电池管理系统设计.pdf
- easy-IoT.rar
- 陶哲轩实分析.pdf
评论
共有 条评论