資源簡(jiǎn)介
使用HAL庫(kù)加載獲取ADS1115的設(shè)備的數(shù)據(jù),進(jìn)行ADC數(shù)據(jù)獲取。
代碼片段和文件信息
/******************************
**?@time;2018/1/16?15:52:55
**?@Author:?mantisAlone
**?@email:?gxd@cyb-bot.com
**?@brief:
*******************************/?
#include?“ADS115.h“
#include?“i2c.h“
#include?“stdint.h“
unsigned?char?WritepointBuf[2];
?uint16_t?data_get;
void?ads115Write(uint16_t?addruint8_t?*reguint16_t?regValue);
void?Confige1115?(unsigned?char?port);
static?void?I2C_ADS1115_Error?(void)
{
????HAL_I2C_DeInit(&hi2c1);
????MX_I2C1_Init();
????printf(“EEPROM?I2C通信超時(shí)!??!?重新啟動(dòng)I2C...\n“);
}
unsigned?char?writeBuf[2];
void?Confige1115?(unsigned?char?port)
{
????unsigned?char?chnel;
????switch?(port)
????{
????case?0:???????????????//0通道
????????chnel=0xC2;
????????break;
????case?1:???????????????//1通道
????????chnel=0xD2;
????????br
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????目錄???????????0??2018-03-05?14:01??ads1115\
?????文件????????2584??2018-03-05?13:58??ads1115\ADS1115.c
?????文件?????????326??2018-03-05?13:59??ads1115\ADS115.h
評(píng)論
共有 條評(píng)論